Hi All,
I have glb cabinet object and I added it to the scene and assign the texture with this code :
textureFloor.encoding = THREE.sRGBEncoding;
child.material.map = textureFloor;
child.material.needsUpdate = true;
But I get this result, I compare between two components, Just the first one is colored successfully.
How Can I solve it in Blender or The solution in Three.js?
If you add a texture to a loaded glTF asset, you also need this line to accommodate the uv specs of glTF.
textureFloor.flipY = false;
Any improvements with this line?
thank you @Mugen87 for your reply.
The result is the same, no different.
In this case I doubt the issue is related to three.js
. The asset is probably not authored correctly in Blender.
I suggest you use the preview in Blender to see how the rendered version of your asset looks like. You likely see the same issue there. The Blender community is however the better place if you have question about authoring your model.
If the model looks good in Blender and here but not with three.js
, you can “reopen” this topic.
1 Like
Also consider that there are many other properties on the material — not just material.map
— that will influence its final appearance. Review the docs for MeshStandardMaterial and compare against your other materials. For example, material.color
is multiplied with material.map
and this would darken the texture if the color is anything other than 0xFFFFFF
(white).
2 Likes
Thank you @Mugen87 , @donmccurdy .
I solved it by this :
child.material.metalness = 0;
child.material.map = textureFloor;
child.material.needsUpdate = true;
1 Like
BTW: I don’t think you need this line.
1 Like