-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Normal issue with new pmremGenerator and StandardNodeMaterial #18360
Comments
I am really looking forward to finding a solution to this issue. If anybody has even a rough idea of which part of the code I shall look into I am really keen. /ping @sunag |
@njarraud Thanks for this, and for your other excellent Node test cases! I do not know where the problem is, but I do know that it has been a challenge to keep Node up-to-date with all the changes in the core library. @sunag has done a great job making those change whenever he is able, but if you'd like to have a go at it, comparing glsl chunks is one reasonable place to start. BTW, the differences you refer to are subtile enough not to readily be apparent -- at least to me. One thing you could do is create two scenes, each with one light, and then make two render passes. That way, each model is identically-lit. Describing what you see as different is helpful. |
I think that this issue already had detect in PREM Update #18161 (comment) ( Unsolved issues )
Yes. Thanks, too.
Thank you @WestLangley. I hope soon I can work it out in full time for it will be faster...
@njarraud This is exactly what you would do too. |
@sunag has created an awesome system and unlocked new possibilities. He is my man. I cannot thank him enough for what he created :-) However this issue makes everything fall down for my use case. The new pmremGenerator is so much better, faster and not buggy compared to the old one but on the other hand the whole system that I developed for the past 6 months and the wow factor resulting is kinda gone because of it. I do not expect sunag to solve it for me and your pointer is very welcome. I'll investigate. I made a couple of examples to get a better idea of the visual differences between both material systems (both used to look identical). Environment texture: The whole benefit of baking round edges on a normal map is gone. It is even more obvious for brighter colours where the normal map is pretty much invisible. Point Light - No difference at all. They are identical to the pixel |
I finally managed to get the same result with MeshStandardMaterial and StandardNodeMaterial. This is the calculation used by the standard material system as found in the file envmap_physical_pars_fragment.glsl.js at line 10 in the getLightProbeIndirectIrradiance function: Does it mean that the normal node with the world scope shall be updated or simply that the irradiance calculation requires something else? |
@njarraud I think you're on the right track. It looks like the reflection is being passed the output of NormalNode (which is only the vertices' contribution) rather than NormalMapNode, which adds the effect of the normal map. In the core shaders I use the first for anti-aliasing and the second for building the reflection vector. That's a likely source of confusion, but I'm not familiar enough with the Node system to fix it myself. @sunag Does that make sense to you? |
@njarraud Wow, you did things get easy now... I should publish a PR in the next few days.
@njarraud I don't know how to thanks for this. You are contributing a lot too.
@elalish Yeah, It makes a lot of sense. |
@elalish Wherein I can find the |
Description of the problem
In the process of moving my app to the latest version of Threejs to have access to the new pmremGenerator, I found an issue with StandardNodeMaterial which wasn't existing before when I was using r108.
When an environment map is used, the normal input is sort of washed away/faded.
When no environment map is used and other types of lights are in the scene, it is back to normal.
I also made a comparison between StandardNodeMaterial and MeshStandardMaterial.
The object with MeshStandardMaterial is correctly rendered with the new pmremGenerator but not the one with StandardNodeMaterial.
I made two jsfiddle. First one is using an environment map - left is MeshStandardMaterial, right is StandardNodeMaterial. Second one is using point lights only:
Three.js version
/ping @sunag
The text was updated successfully, but these errors were encountered: