As you can see the white color looks blueish in three.js and the box have two parts, both have the same material applied (White) however in three.js the outer part becomes grey and the inner part becomes white.
I have no idea why the material change color depending on object, or why it becomes blue.
Please help!
Have you tried changing the .outputColorSpace
to THREE.SRGBColorSpace
?
This can also be caused due to color and intensity of the lights used inside the scene. Try increasing the intensity of the AmbientLight
if used maybe that will make the objects color to be enhanced or become visible.
Note, this is the default value in three.js r152+.
@Pontus I would start by viewing your glTF model in 1-2 online viewers. You can expect some variation in lighting (which is specific to each viewer).
Assuming you see the same issues in online viewers (I suspect you will) then there is something about how the model has been set up in Blender that is incorrect, you can share the model or refer to the glTF exporter documentation for tips.
As @AshhadDevLab mentions, lighting is very important to the overall look, but with only screenshots … we are just guessing about what you might be doing, both in Blender and in three.js.
I didn’t know that, I guess that’s new info for me!
I think i found the reason, somehow the strangely colored object had an attribute on its geometry called “color”. It must have followed into the obj file when the 3D was converted from step format