Fog Shader Node Linear Fog mode goes negative?

Hi Folks,

I had a look at the shader code generated by the NME fog shader Node.
I think the fog coefficient in the function CalcFogFactor becomes negative for distances greater then the fog end value.

fogCoeff=(fogEnd-fogDistance)/(fogEnd-fogStart);

Greetings
Tom

fogCoeff will be clamped to 0 if it is negative and it is correct when you have a distance over the fog end.

1 Like

Yes you are right