Explorar el Código

Merge pull request #16626 from dumganhar/patch-1

Check whether saturate macro was defined in common.glsl.js.
Mr.doob hace 6 años
padre
commit
4f942f9178
Se han modificado 1 ficheros con 3 adiciones y 0 borrados
  1. 3 0
      src/renderers/shaders/ShaderChunk/common.glsl.js

+ 3 - 0
src/renderers/shaders/ShaderChunk/common.glsl.js

@@ -7,7 +7,10 @@ export default /* glsl */`
 #define LOG2 1.442695
 #define EPSILON 1e-6
 
+#ifndef saturate
+// tonemapping_pars_fragment may have defined saturate() already
 #define saturate(a) clamp( a, 0.0, 1.0 )
+#endif
 #define whiteComplement(a) ( 1.0 - saturate( a ) )
 
 float pow2( const in float x ) { return x*x; }