Skip to content

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
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?


} 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.

2 participants