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

SplitNode: Fix unecessary swizzle #24170

Merged
merged 2 commits into from
Jun 1, 2022
Merged

Conversation

sunag
Copy link
Collaborator

@sunag sunag commented Jun 1, 2022

Description

The idea is to force the optimization in case the user sets this unnecessarily.

After:
.. nodeVary3.xyz.xyz ..

// FLOW -> TransformedNormalView
nodeVar7 = cross( dpdy( nodeVary3.xyz.xyz ), normalize( nodeVary4 ) );
nodeVar8 = dpdx( nodeVary1.xy );
nodeVar9 = cross( normalize( nodeVary4 ), dpdx( nodeVary3.xyz.xyz ) );
nodeVar10 = dpdy( nodeVary1.xy );
...

Before:
.. nodeVary3.xyz ..

// FLOW -> TransformedNormalView
nodeVar7 = cross( dpdy( nodeVary3.xyz ), normalize( nodeVary4 ) );
nodeVar8 = dpdx( nodeVary1 );
nodeVar9 = cross( normalize( nodeVary4 ), dpdx( nodeVary3.xyz ) );
nodeVar10 = dpdy( nodeVary1 );
...

This contribution is funded by Google via Igalia

@sunag sunag added this to the r142 milestone Jun 1, 2022
@sunag
Copy link
Collaborator Author

sunag commented Jun 1, 2022

@LeviPesin I love yours revisions, thanks!

@sunag sunag merged commit 7713736 into mrdoob:dev Jun 1, 2022
@sunag sunag deleted the dev-optimize-swizzling branch June 1, 2022 21:36
abernier pushed a commit to abernier/three.js that referenced this pull request Sep 16, 2022
* SplitNode: Fix unecessary swizzle

* replace .substr() to .slice()
snagy pushed a commit to snagy/three.js-1 that referenced this pull request Sep 21, 2022
* SplitNode: Fix unecessary swizzle

* replace .substr() to .slice()
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