My model looks good in sandbox but ugly in editor and web page

Hello everyone, I create a model in blender and export in gltf (glb)
When i open sandbox.babylonjs.com and drag the file it look good.

But if I open the same file in babylon editor for Windows 10 looks ugly, the same for web page.

Hello and welcome!!

For glb file you need to provide an environment as glb uses IBL (Image Based Lighting),

Here is the code for it in the sandbox:

This is my first page using babylon, I am newbie

Babylon - Getting Started
<script src="https://preview.babylonjs.com/gui/babylon.gui.min.js"></script>
<style>
    html, body {
        overflow: hidden;
        width   : 100%;
        height  : 100%;
        margin  : 0;
        padding : 0;
    }

    #renderCanvas {
        width   : 100%;
        height  : 100%;
        touch-action: none;
    }
</style>
window.addEventListener('DOMContentLoaded', function() { // All the following code is entered here.
        var canvas = document.getElementById('renderCanvas');
        var engine = new BABYLON.Engine(canvas, true);

        var createScene = function() {
            var scene = new BABYLON.Scene(engine);

            // This creates and positions a universal camera (non-mesh)
            var camera = new BABYLON.UniversalCamera("camera", new BABYLON.Vector3(0, 30, 20), scene);

            // This targets the camera to scene origin
            camera.setTarget(BABYLON.Vector3.Zero());

            // This attaches the camera to the canvas
            camera.attachControl(canvas, true);

            var light = new BABYLON.PointLight("HemiLight", new BABYLON.Vector3(0, 20, 0), scene);


            var mesh = BABYLON.SceneLoader.Append("./", "Demo2.glb", scene, function (scene) {
            // do something with the scene
            });
            return scene;
        }

        var scene = createScene();
        engine.runRenderLoop(function() {
            scene.render();
        });

        window.addEventListener('resize', function() {
            engine.resize();
        });

    });
</script>

I add this line in CreateScene function and look better
scene.environmentTexture = BABYLON.CubeTexture.CreateFromPrefilteredData(“https://assets.babylonjs.com/environments/studio.env”, scene);

But if I move the camera with arrows keys some faces disapear

It will be complicated to help without a repro :frowning:
can you try to create a Playground with your issue ?

https://doc.babylonjs.com/resources/external_pg_assets

1 Like

https://www.babylonjs-playground.com/#4DDWC6

https://www.babylonjs-playground.com/#4DDWC6#1

The problem is that whilst using instance if the root goes out of screen you do not render any of the instances anymore :slight_smile:

Thanks a lot

Actually I think it is a bug

Can you repro with a more simple model? Like only a root and an instance? You should not have to force the selection

Ok actually I found it and the fix will be in next nightly :slight_smile:

1 Like