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

WebGLProgram: Don't use tangents when flat shading. #26197

Merged
merged 1 commit into from
Jun 7, 2023

Conversation

WestLangley
Copy link
Collaborator

The shaders will not compile when flat shading is enabled and geometry tangents are present.

An alternative fix would be to add a change to WebGLPrograms.js instead.

vertexTangents: !! geometry.attributes.tangent && ( HAS_NORMALMAP || HAS_ANISOTROPY ) && ( material.flatShading === true ),

Or, we could try to fix the shaders.

@WestLangley WestLangley added this to the r154 milestone Jun 5, 2023
@github-actions
Copy link

github-actions bot commented Jun 5, 2023

📦 Bundle size

Full ESM build, minified and gzipped.

Filesize dev Filesize PR Diff
644.1 kB (159.5 kB) 644.1 kB (159.5 kB) +40 B

🌳 Bundle size after tree-shaking

Minimal build including a renderer, camera, empty scene, and dependencies.

Filesize dev Filesize PR Diff
434.1 kB (105.1 kB) 434.2 kB (105.1 kB) +40 B

@Mugen87 Mugen87 changed the title Src: Don't use tangents when flat shading WebGLProgram: Don't use tangents when flat shading. Jun 7, 2023
@Mugen87 Mugen87 merged commit 74b9e7e into mrdoob:dev Jun 7, 2023
@WestLangley WestLangley deleted the dev-tangents-flat-shading branch June 7, 2023 15:47
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