1

Am using BabylonJS to render my glb file, which I generated with Blender.

I have some image textures, displayed as posters over my wall in the model. They are pretty sharp images.

When I export the model as gltf file, and load in babylonJS, the image quality of those textures are perfect. But, if I export as glb file, I see a significant degradation in quality of my images.

var scene = new BABYLON.Scene(engine);

BABYLON.SceneLoader.Append(
     './',
     'mymodel.glb',
     scene
);

This is how I load my model using babylon.

Not sure, why .glb format only is causing problems.

Maheswaran Ravisankar
  • 17,652
  • 6
  • 47
  • 69

1 Answers1

0

you should load your glb file vie live server it not load from local assets

var model= BABYLON.SceneLoader.Append( "https://rawcdn.githack.com/mrdoob/three.js/36f9f34752a985359e2556c68a52234436cefdfa/examples/models/gltf/RobotExpressive/", "RobotExpressive.glb", scene, function (newMeshes) { var mesh = scene.meshes[0];

        // let meshMat = scene.getMeshByName("RobotExpressive")

        // meshMat.material.albedoTexture = new BABYLON.Texture("https://babylon.sfo3.digitaloceanspaces.com/brick_wall_001_diffuse_2k.jpg", scene); 

        mesh.position.y = -2.5;
        //mesh.position.z  =  2.5;
        mesh.rotation = new BABYLON.Vector3(0, Math.PI / 2, 0);
        //mesh.scaling = new BABYLON.Vector3(2, 2, 2);
        camera.lookAt(mesh);

        scene.activeCamera = null;
        scene.createDefaultCameraOrLight(true);
        scene.activeCamera.attachControl(canvas, false);
      }
    );
enter code here