Skip to content

Conversation

Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Mar 30, 2025

Related issue: https://discourse.threejs.org/t/webgpu-flatshading-doubleside-broken/80198

Description

The PR ensures normals are not flipped when using flat shading.

Copy link

github-actions bot commented Mar 30, 2025

📦 Bundle size

Full ESM build, minified and gzipped.

Before After Diff
WebGL 336.08
78.29
336.08
78.29
+0 B
+0 B
WebGPU 532.64
148.02
532.77
148.04
+127 B
+26 B
WebGPU Nodes 532.11
147.91
532.24
147.94
+127 B
+26 B

🌳 Bundle size after tree-shaking

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

Before After Diff
WebGL 465.09
112.16
465.09
112.16
+0 B
+0 B
WebGPU 604.28
163.99
604.41
164.01
+127 B
+19 B
WebGPU Nodes 559.32
153.43
559.39
153.46
+76 B
+22 B

@Mugen87 Mugen87 added this to the r176 milestone Mar 30, 2025
@Mugen87 Mugen87 marked this pull request as draft March 30, 2025 09:22
@Mugen87 Mugen87 changed the title Normal: Don't flip normals when using flat shading. FrontFacingNode: Don't flip normals when using flat shading. Mar 30, 2025
@Mugen87 Mugen87 marked this pull request as ready for review March 30, 2025 09:37
@Mugen87 Mugen87 changed the title FrontFacingNode: Don't flip normals when using flat shading. Normal: Don't flip normals when using flat shading. Mar 30, 2025
@Mugen87 Mugen87 marked this pull request as draft March 30, 2025 09:55
@sunag sunag marked this pull request as ready for review March 30, 2025 15:06
@sunag sunag merged commit aa7f5b9 into mrdoob:dev Mar 30, 2025
12 checks passed
@WestLangley
Copy link
Collaborator

If the front side is extruded by a normal map, then the back side should be indented. With this PR, both sides are extruded when flat shading is true.

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.

3 participants