-
-
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
WebGPURenderer: Performance revision #26556
Conversation
@@ -16,7 +16,7 @@ class Object3DNode extends Node { | |||
|
|||
this.updateType = NodeUpdateType.OBJECT; | |||
|
|||
this._uniformNode = uniform( null ); | |||
this._uniformNode = new UniformNode( null ); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What is the difference here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It was part of what I described about avoiding NodeObject (Use Non-NodeObject for uniforms.
), in general Nodes that need to be updated for every frame.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what is the benefit then? UniformNode
is still a node.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
But what is the benefit then?
Better performance.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a significant difference in performance between a node and a node wrapped in nodeObject
?
@@ -37,6 +37,10 @@ const shaderNodeHandler = { | |||
|
|||
return ( ...params ) => nodeElement( nodeObj, ...params ); | |||
|
|||
} else if ( prop === 'self' ) { | |||
|
|||
return node; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it should be something like node.self || node
?
Related issue: #26469
Description
Cache NodeBuilder
Caching NodeBuilder reduces significantly compilation time when there are many objects in the scene.
Use Non-NodeObject for uniforms.
The function added
Node.getSelf()
gets a Non-NodeObject, this helps performance on uniforms because it doesn't need to pass TSL processing in the Proxy class.Cache MaterialNode uniforms
Caching
MaterialNode
uniforms andNodeUpdateType.RENDER
usage reduces redundant update cycles.--
Some other minor improvements have been made.
This work continues in other PR.