Skip to content

Commit 3ac7fa7

Browse files
authored
Merge pull request #17586 from WestLangley/dev_adreno_frontfacing
NormalMap Shader: fix Adreno work-around
2 parents cfdfcd7 + 85c291b commit 3ac7fa7

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/renderers/shaders/ShaderChunk/normalmap_pars_fragment.glsl.js

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -39,14 +39,8 @@ export default /* glsl */`
3939
#ifdef DOUBLE_SIDED
4040
4141
// Workaround for Adreno GPUs gl_FrontFacing bug. See #15850 and #10331
42-
// http://hacksoflife.blogspot.com/2009/11/per-pixel-tangent-space-normal-mapping.html?showComment=1522254677437#c5087545147696715943
43-
vec3 NfromST = cross( S, T );
44-
if( dot( NfromST, N ) > 0.0 ) {
4542
46-
S *= -1.0;
47-
T *= -1.0;
48-
49-
}
43+
if ( dot( cross( S, T ), N ) < 0.0 ) mapN.xy *= - 1.0;
5044
5145
#else
5246

0 commit comments

Comments
 (0)