-
-
Notifications
You must be signed in to change notification settings - Fork 35.3k
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
Node material compiling performance issue #18511
Comments
Thanks, I actually didn't know about this. I'll check that. |
After merging #19673 and There might be no performance improvement for the actual compilation. But you should see faster execution times when the renderer has to check for a potentially required compilation in |
Closing due to lack of feedback. |
Description of the problem
I have been using the node material system in production for a bit now and one of the thing which is currently the biggest issue is the compiling time. It was somehow expected that it would take more time than the standard threejs system, but the difference is huge in an environment where materials are numerous and have to be updated often.
One of the longest operations is to build the fragment shader code especially when using an HDR environment map. This is a killer. In my case it takes 90% of the fragment code build time. Considering that the exact same operation is done over and over again for each material of the scene (most of the time all objects have the same environment setup), there is maybe something to to do to make the calculation only once and save almost 90% of the combined fragment shader code build times?
Example with my test material (environment, color, metalness, roughness, normal):
The difference between MeshStandardMaterial and StandardNodeMaterial is even more impressive. Example with my test scene including 100 different materials:
In a CAD environment dealing with 1000s of different objects and with a material number that can be much bigger than my test scene, it is a really big deal. To switch between different viewport display settings it was taking just a few milliseconds which was invisible to the user while now it can take multiple seconds with the node material system.
I am not complaining, just reporting and maybe hoping to find some optimizations to make this system even more awesome.
/ping @sunag
Three.js version
Browser
OS
The text was updated successfully, but these errors were encountered: