Skybox with CubeTexture is blank

Any guesses as to why my sky is blank white? Im stumpified.
Using Import because Webpack. Console 404s are gone, so it’s not that. Images are fine in preview.
Code was only slightly modified from tutorial at Skyboxes | Babylon.js Documentation


import bluecloud_px from '../assets/textures/bluecloud_px.jpg';
import bluecloud_py from '../assets/textures/bluecloud_py.jpg';
import bluecloud_pz from '../assets/textures/bluecloud_pz.jpg';
import bluecloud_nx from '../assets/textures/bluecloud_nx.jpg';
import bluecloud_ny from '../assets/textures/bluecloud_ny.jpg';
import bluecloud_nz from '../assets/textures/bluecloud_nz.jpg';
...
    const skybox = MeshBuilder.CreateBox("skyBox", {size:150}, scene);

    const skyboxMaterial = new StandardMaterial("skyBox", scene);
    skyboxMaterial.backFaceCulling = false;
    skyboxMaterial.reflectionTexture = new CubeTexture("", scene,
        [ bluecloud_px, bluecloud_py, bluecloud_pz, bluecloud_nx, bluecloud_ny, bluecloud_nz ]);
    skyboxMaterial.reflectionTexture.coordinatesMode = Texture.SKYBOX_MODE;
    skyboxMaterial.diffuseColor = new Color3(0, 0, 0);
    skyboxMaterial.specularColor = new Color3(0, 0, 0);

    skybox.material = skyboxMaterial;

If the preview of the cube texture in the inspector is ok, I think we will need a live link to be able to help, as the code you reported may not be the problem.

1 Like