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

WebGLRenderer: Compute .vertexTangents consistently. #22564

Merged

Conversation

donmccurdy
Copy link
Collaborator

Related issue: #22530

We need to compute program parameters consistently in these locations:

const vertexTangents = !! object.geometry && !! object.geometry.attributes.tangent;

vertexTangents: ( !! material.normalMap && !! object.geometry && !! object.geometry.attributes.tangent ),

That's easy to miss, and if they don't match can cause performance issues similar to the one identified in #22530. It'd be great if we can find a solution to #22530 that avoids having to compute these parameters in two locations. For now this PR just removes one case that may fall into that problem.

@mrdoob mrdoob added this to the r133 milestone Sep 22, 2021
@mrdoob mrdoob merged commit af99874 into mrdoob:dev Sep 22, 2021
@mrdoob
Copy link
Owner

mrdoob commented Sep 22, 2021

Thanks!

@donmccurdy donmccurdy deleted the bug-webglrenderer-vertextangents-invalidation branch September 22, 2021 14:43
@Usnul
Copy link
Contributor

Usnul commented Oct 5, 2021

would it make sense to refactor this out, to avoid divergence in the future? or comment for future devs perhaps?

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.

4 participants