-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
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
WebGPURenderer: Increase performance #26673
Comments
I was about to comment. I just made new builds to figure out the iife bundle issue. And super low resources with video textures. https://danrossi.github.io/three-webgpu-renderer/tests/webgpu_video_panorama_equirectangular.html and using video frame callback |
There is apparently still an issue with WebGPUrenderer and shadows. On a program with a single DirectionalLight that has shadow definitions, and that uses non-emissive materials (e.g. Lambert and Phong), switching to WebGPUrenderer will cause a massive slowdown. Oddly, if I remove the light, WebGPUrender will cause all the materials to become emissive - with the result that shadows are no longer an issue and the program operates at normal speed. (This has nothing to do with the use of NodeMaterials as I first thought since the same thing happens with regular Materials.) If it helps, I also had to add a bias definition to fix the appearance of some materials. |
@PhilCrowther Could it be related to this ? |
@sunag Not sure. I have created a small demo on CodePen. |
Hmm... thanks for the example. It looks like there is a conflict in Related: #24755 Anyway, I'll be checking for a fix for this. |
Yes, that appears to have fixed the problems I was having with various versions of the program. I had to disable a smoke emitter, but I plan to update that anyways using the WebGPU Particles example. Thanks for the quick response! |
I don't know if any of this is useful to three.js but this article has some ideas for WebGPU performance. There are also some hopefully equivalent WebGL examples linked at the bottom of this page for comparison Certainly, WebGPU implementaitions should find ways to increase perf more but at a glance it seems like it should be possible to go as fast or faster then WebGL. |
Description
I started a work to increase the performance in
WebGPURenderer
and it will work for bothBackends
, it's about a better management ofBindings
andCache
.Solution
material.needsUpdate=true
-- Reuse NodeBuilder #26729NodeBuilder
based fromCache Key
, currently the cache uses Material/Geometry as reference. For example, this means that two Materials of the same type with only a different color will be compiled twice instead of reuse theNodeBuilder
, this sharing already happens for the GPU Program, but as the code is dynamically generated this optimization process should be API oriented for the Nodes. -- Reuse NodeBuilder #26729NodeBuilderState
to reduce memory usage when reuseNodeBuilder
-- Reuse NodeBuilder #26729FRAME
,RENDER
,OBJECT
groups. Node System already offers this support, we would have to take it to the level of optimization for the Bindings.The text was updated successfully, but these errors were encountered: