I'm struggling with shaders because I want the fog to be reflected in the water using Three.js sky_sun_shader. I added the following code snippet to the fragment Shader:
THREE.ShaderChunk[ "fog_pars_fragment" ],
THREE.ShaderChunk ["fog_fragment" ],
This setup worked perfectly fine with r71 but encountered an error when used with r101:
THREE.WebGLProgram: shader error: 0 35715 false gl.getProgramInfoLog Variations with the same name but different type, or statically used variations in fragment shader are not declared in vertex shader: fogDepth
How do I go about fixing this issue?
Sample code from the shader:
THREE.ShaderLib['water'] = {
uniforms: THREE.UniformsUtils.merge( [
THREE.UniformsLib[ "fog" ], {
"normalSampler": { type: "t", value: null },
"mirrorSampler": { type: "t", value: null },
"alpha": { type: "f", value: 1.0 },
"time": { type: "f", value: 0.0 },
...
}
] ),
vertexShader: [...],
fragmentShader: [...]
};