render.wrl (184.0 KB)
Three.js Version 149
I am trying to render VRML files using the loader, but when rendered in 3js, the color and texture all come out very dull. When rendered using online viewers, they come out vibrant and saturated like the original cad model. I tried adding different types of lighting the shading comes out to be right just the original color scheme seems to be off. Multitude of VRML files were tested and results were the same with the black part not showing as black.
Code snippet on scene generation (within Angular frontend)
Note that this didn’t work with the minimal settings (simple light and loaded in component)
this.scene = new THREE.Scene();
const ambientLight = new THREE.AmbientLight("#e0e0e0", 0.5);
this.scene.add( ambientLight );
const pointLight = new THREE.PointLight("#e0e0e0", 1);
pointLight.position.set( 200, 100, 0 );
this.scene.add( pointLight );
this.camera = new THREE.PerspectiveCamera(
90,
this.width / this.width
);
this.camera.position.z = 5;
this.renderer = new THREE.WebGLRenderer({
canvas: document.getElementById("modelContainer"),
antialias: true,
stencil: true
});
this.renderer.setPixelRatio( window.devicePixelRatio );
this.renderer.outputEncoding = THREE.LinearEncoding;
this.renderer.toneMapping = THREE.NoToneMapping;
Would appreciate any help and let me know if more information needs to be provided