Browse Source

ShaderChunk: Pass isFrontFacing to perturbNormalArb.

Mr.doob 4 years ago
parent
commit
bdb82a8816

+ 1 - 1
src/renderers/shaders/ShaderChunk/bumpmap_pars_fragment.glsl.js

@@ -22,7 +22,7 @@ export default /* glsl */`
 
 	}
 
-	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy ) {
+	vec3 perturbNormalArb( vec3 surf_pos, vec3 surf_norm, vec2 dHdxy, bool isFrontFacing ) {
 
 		// Workaround for Adreno 3XX dFd*( vec3 ) bug. See #9988
 

+ 2 - 2
src/renderers/shaders/ShaderChunk/normal_fragment_begin.glsl.js

@@ -1,5 +1,5 @@
 export default /* glsl */`
-// Workaround for Adreno/Nexus5 not able able to do dFdx( vViewPosition ) ...
+// Workaround for Adreno GPUs not able to do dFdx( vViewPosition )
 
 vec3 fdx = vec3( dFdx( vViewPosition.x ), dFdx( vViewPosition.y ), dFdx( vViewPosition.z ) );
 vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPosition.z ) );
@@ -14,7 +14,7 @@ vec3 fdy = vec3( dFdy( vViewPosition.x ), dFdy( vViewPosition.y ), dFdy( vViewPo
 
 #endif
 
-// Workaround for Adreno GPUs gl_FrontFacing bug. See #10331 and #15850
+// Workaround for Adreno GPUs gl_FrontFacing bug. See #10331 and #15850.
 
 bool isFrontFacing = dot( normal, normalize( cross( fdx, fdy ) ) ) > 0.0;