2
0
Эх сурвалжийг харах

ShaderChunk: Fixed objectspace normalmap

Mr.doob 4 жил өмнө
parent
commit
13b3d6542d

+ 3 - 1
src/renderers/shaders/ShaderChunk/normal_fragment_maps.glsl.js

@@ -12,7 +12,9 @@ export default /* glsl */`
 
 
 	#ifdef DOUBLE_SIDED
 	#ifdef DOUBLE_SIDED
 
 
-		normal = normal * ( float( isFrontFacing ) * 2.0 - 1.0 );
+		// We can't compute isFrontFacing if the model doesn't have normals
+
+		normal = normal * ( float( gl_FrontFacing ) * 2.0 - 1.0 );
 
 
 	#endif
 	#endif