Reputation: 437
I imported in my Three.js project a gltf model exported from Blender.
I know the model is correct and it is perfectly rendered in https://gltf-viewer.donmccurdy.com/.
But in my Three.js project it seems to have a worse quality as you can see from these screenshots:
https://ibb.co/qrqX8dF (donmccurdy viewer)
https://ibb.co/71wLDLJ (my project)
I dont know if this can be a problem of lighting or some setting in the renderer object.
This is my renderer and light settings:
// renderer
var renderer= new THREE.WebGLRenderer();
renderer.setSize(window.innerWidth, window.innerHeight);
renderer.setClearColor (0xf9f9f9, 1);
renderer.gammaOutput= true;
renderer.antialias= true;
renderer.setPixelRatio(window.devicePixelRatio);
document.body.appendChild(renderer.domElement);
// light
var directionalLight= new THREE.DirectionalLight(0xffffff, 0.9);
scene.add(directionalLight);
Any help will be appreciated.
Upvotes: 2
Views: 658
Reputation: 31026
renderer.antialias= true;
It's not valid to set the antialias
parameter like this. All WebGL rendering context parameters must be applied to the constructor. Do it like so
renderer = new THREE.WebGLRenderer( { antialias: true } );
Upvotes: 3