Skip to content
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

Merged
merged 1 commit into from Aug 9, 2023
Merged

WebGPURenderer: Performance revision #26556

merged 1 commit into from Aug 9, 2023

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Aug 9, 2023

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 and NodeUpdateType.RENDER usage reduces redundant update cycles.

--
Some other minor improvements have been made.

This work continues in other PR.

@sunag sunag added this to the r156 milestone Aug 9, 2023
@sunag sunag marked this pull request as ready for review August 9, 2023 16:34
@sunag sunag merged commit 0b16913 into mrdoob:dev Aug 9, 2023
18 checks passed
@@ -16,7 +16,7 @@ class Object3DNode extends Node {

this.updateType = NodeUpdateType.OBJECT;

this._uniformNode = uniform( null );
this._uniformNode = new UniformNode( null );
Copy link
Contributor

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?

Copy link
Collaborator Author

@sunag sunag Sep 4, 2023

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.

Copy link
Contributor

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.

Copy link
Collaborator Author

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.

Copy link
Contributor

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;
Copy link
Contributor

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?

@Methuselah96 Methuselah96 mentioned this pull request Jan 18, 2024
45 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants