I’m trying to override the fog shader chunk, but the method addFog is not replaced. The scene fog is set to exponential squared, so I tried replacing the chunk fogExp2PS with the following shader code:
// Custom Shader Chunk for fogLinearPS / fogExpPS / fogExp2PS
uniform vec3 fog_color;
uniform float fog_density;
vec3 addFog(vec3 color) {
// overwrite with green color
return vec3(0.0, 1.0, 0.0);
}
The box in the middle should get green, but it has the default fog applied:
The code to insert the correct fog chunk is ignoring the specified custom chunks and just looking at the built-in chunks. I’ve submitted an issue report for you on the engine repo:
Feel free to subscribe to that to get updates on a fix.
Hi @will, thanks a lot for the answer and reasearch! I found a PR that already handles the problem, might be the interesting to pull out the changes from there into a new PR. I’ll follow the conversation on Github, thanks for opening an issue there