Unity Shader Graph Fog node shows density inverted when using Linear Fog. Also not properly showing the color of the fog on far objects.
Asked
Active
Viewed 56 times
1 Answers
0
Seems we are missing one step in the fog calculation. This custom node fix the issue.
Custom node body:
fogIntensity = 0;
#if defined(FOG_EXP)
fogIntensity = 1 - saturate(exp2(-fogFactor));
#elif defined(FOG_EXP2)
fogIntensity = 1 - saturate(exp2(-fogFactor * fogFactor));
#elif defined(FOG_LINEAR)
fogIntensity = 1 - fogFactor;
#endif
Custom node Settings:
Custom node usage:
Results:

Iroqas
- 65
- 9