Unable to Render the textures of the model in Babylon.js

I tried to load my model into the babylon.js scene, but some textures are not rendering correctly like Glass material, I’ve even tried uploading the model into sandbox to check whether my model is having any but everything seems to be fine. I have attached the pictures of the model in sandbox and in the scene.

The first picture is from Sandbox and the second one is from the scene.

My guess is the skybox is not present so you don’t have reflections. Can you please try to add a skybox in your playground?

1 Like

Yes, Skybox is already present.
Here is the code:
var skybox = BABYLON.MeshBuilder.CreateBox(
{ size: 5000.0 },
var skyboxMaterial = new BABYLON.StandardMaterial(“skyBox”, scene);
skyboxMaterial.backFaceCulling = false;
skyboxMaterial.reflectionTexture = new BABYLON.CubeTexture(
skyboxMaterial.reflectionTexture.coordinatesMode =
skyboxMaterial.diffuseColor = new BABYLON.Color3(0, 0, 0);
skyboxMaterial.specularColor = new BABYLON.Color3(0, 0, 0);
skybox.material = skyboxMaterial;
skybox.intensity = 10;

Try to add these lines:

hdrTexture = new BABYLON.CubeTexture.CreateFromPrefilteredData("textures/environment.env", scene);
    hdrTexture.onLoadObservable.add(() => {
        scene.environmentTexture = hdrTexture;
1 Like

After adding skybox i added these lines, it worked perfectly. :slight_smile: