Check whether saturate macro was defined in 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; }