Patch a WebGL fragment shader so its transmission pass ignores the sampled alpha.
Pure over its inputs so the substitution is unit-testable against three's real chunk:
#include <transmission_fragment> (still unresolved when onBeforeCompile runs) is
replaced by the chunk body with TRANSMISSION_ALPHA_MIX_LINE pinned. A shader
without the include (no transmission) is returned untouched. If a three upgrade moves
the line, the shader is left to three's own include resolution and one warning names
the consequence; the unit test on the real chunk turns that drift into a red build.
Parameters
fragmentShader: string
shader.fragmentShader as handed to onBeforeCompile
transmissionChunk: string
THREE.ShaderChunk.transmission_fragment (passed in so this
module keeps its type-only three import)
Patch a WebGL fragment shader so its transmission pass ignores the sampled alpha.
Pure over its inputs so the substitution is unit-testable against three's real chunk:
#include <transmission_fragment>(still unresolved whenonBeforeCompileruns) is replaced by the chunk body with TRANSMISSION_ALPHA_MIX_LINE pinned. A shader without the include (no transmission) is returned untouched. If a three upgrade moves the line, the shader is left to three's own include resolution and one warning names the consequence; the unit test on the real chunk turns that drift into a red build.