Hello! I load an object with GLTFLoader
But some details ob this object are not smooth.
for example
in three js
It should be more smooth
in three js after loaded
but it should be
How can I fix it?
Hello! I load an object with GLTFLoader
But some details ob this object are not smooth.
for example
in three js
It should be more smooth
in three js after loaded
but it should be
How can I fix it?
Are you exporting your models from Blender?
i export model from cinema 4D in fbx format, then convert it in .glb with https://blackthread.io/loader/
I can’t to fix it with cinema 4D or blender, and find the way to fix it with three
In blender or cinema 4D I can’t see this effect
From my point of view this is a modeling issue. In Blender you can change between smooth and flat shading, see:
https://en.blender.org/index.php/Doc:2.6/Manual/Modeling/Meshes/Smoothing
Cinema 4D provides a similar option for sure.
I can’t to fix it with three setting of material?
In blender or cinema 4D I can’t see this effect
three.js
does smooth shading per default. You can only force flat shading by setting the flatShading
material property to true
. Besides, you can try to call BufferGeometry.computeVertexNormals() but the outcome depends on your geometry. Geometry.computeFlatVertexNormals() is another option.
In any event, it’s not ideal to fix this issue with the 3D engine. You should export your model in a way so you can directly render it without manual adjustments.
I tried with flatShading as
but didn’t see the result
gltf.scene.traverse((node) => {
if (node.isMesh) {
node.material.flatShading = true;
}
});
I thought you want smooth shading?
I have No results with this code
object.traverse((node) => {
if (node.isMesh) {
console.log('node', node)
node.material.smoothShading = true;
}
});
No results too
object.traverse((node) => {
if (node.isMesh) {
console.log('node', node)
node.material.flatShading = true;
}
});
I try to use computeFlatVertexNormals but haven’t any results
Can you help me in my codepen ? or maybe give me some examples
Material.smoothShading
does not exist. Besides, your codepen does not seem to work.