Skip to content

Examples: Properly transform normal - #34039

Merged
sunag merged 1 commit into
mrdoob:devfrom
WestLangley:dev-skinning_instancing_indiv
Jul 14, 2026
Merged

sunag merged 1 commit into
mrdoob:devfrom
WestLangley:dev-skinning_instancing_indiv

Conversation

@WestLangley

@WestLangley WestLangley commented Jul 14, 2026 •

Copy link
Copy Markdown
Collaborator

Avoid passing a normal into .transformDirection().

Compare with skinnormal_vertex.glsl.js

@WestLangley WestLangley added this to the r186 milestone Jul 14, 2026
const instanceMatrix = instanceMatricesNode.element( meshInstance );

vertices.element( targetOffset ).assign( vec4( instanceMatrix.mul( skinPosition ).xyz, 1 ) );
vertices.element( targetOffset.add( uint( 1 ) ) ).assign( vec4( transformNormal( skinNormal, instanceMatrix ), 0 ) );

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The instance matrix should not require a normal matrix calculation, unless you introduced shear.

Compare with defaultnormal_vertex.glsl.js

It is up to you if you want to leave this as-is.

/ping @sunag, @Mugen87

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sunag
sunag merged commit d137808 into mrdoob:dev Jul 14, 2026
8 checks passed
@WestLangley
WestLangley deleted the dev-skinning_instancing_indiv branch July 15, 2026 00:40
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