mrdoob / three.js

JavaScript 3D Library.
https://threejs.org/
MIT License
103.09k stars 35.42k forks source link

Inappropriate color of LDraw part #24982

Open Pdzoc opened 2 years ago

Pdzoc commented 2 years ago

Describe the bug

Three.js (LDrawLoader) displays black part instead of grey.

There was no error on Windows 7 with Three.js version: 137 and Chrome. The only difference is Windows 10 and maybe newer version of Chrome. Updating three.js (137 -> 147) doesn't fix the problem. I use several models and for now I've found problem with one model, although LDraw Model Viewer displays this model correctly.

Screenshots

ldrawIssue Left: index.html opened with live server. Right: view from LDraw Model Viewer

Platform:

gkjohnson commented 2 years ago

Can you provide a repo case so this can be tested?

yomboprime commented 2 years ago

Also, does the console show any warning?

Most probably it will be an issue with the materials library.

Pdzoc commented 2 years ago

There were no errors in console in either the original file or the test file from this repo streetBug

gkjohnson commented 2 years ago

Looks like this might be related to #24635. Disabling "smoothNormals" fixes the issue:

image
Pdzoc commented 2 years ago

Right - adding line: lDrawLoader.smoothNormals = false; fix the problem. Thanks for help!

gkjohnson commented 2 years ago

lDrawLoader.smoothNormals = false isn't a proper fix - it's just a workaround. I think we should keep this open until we know it's related to https://github.com/mrdoob/three.js/issues/24635.

dcm03 commented 1 year ago

It sounds like you are experiencing an issue with the display of LDraw models in Three.js on a Windows 10 machine, where certain parts are being displayed as black instead of grey. This issue may be specific to a newer version of Chrome, as it was not present on a Windows 7 machine with an older version of Chrome.

There could be a number of reasons why this issue is occurring. It's possible that there is a bug in the LDrawLoader code that is causing the incorrect display of certain parts. It could also be an issue with the model itself, or with the way that the model is being loaded or rendered in Three.js.

To try to resolve this issue, you could try the following steps:

Make sure that you are using the latest version of Three.js and the LDrawLoader. Sometimes bugs are fixed in newer versions of a library, so updating to the latest version may help.

Check the model file for any errors or issues that could be causing the incorrect display of certain parts. You can use the LDraw Model Viewer to view the model and see if it displays correctly there.

Check the code that is loading and rendering the model in Three.js to make sure that it is correct and that there are no errors or issues that could be causing the incorrect display.

Try using a different browser or a different version of Chrome to see if the issue is specific to the browser or version that you are currently using.

If none of these steps helps, you may want to consider posting a question on a forum or Stack Overflow with more details about the issue and the steps you have already taken to try to resolve it. Providing a minimal, reproducible example of the issue would also be helpful in getting assistance.

yomboprime commented 1 year ago

There could be a number of reasons why this issue is occurring...

This comment seems GPT-generated and is useless.

LeviPesin commented 1 year ago

I've reported @dcm03 to GitHub Support.