Fog.frag 369 B

1234567891011121314
  1. vec3 GetFog(vec3 color, float depth)
  2. {
  3. return mix(cFogColor, color, clamp((cFogParams.x - depth) * cFogParams.y, 0.0, 1.0));
  4. }
  5. vec3 GetLitFog(vec3 color, float depth)
  6. {
  7. return color * clamp((cFogParams.x - depth) * cFogParams.y, 0.0, 1.0);
  8. }
  9. float GetFogFactor(float depth)
  10. {
  11. return clamp((cFogParams.x - depth) * cFogParams.y, 0.0, 1.0);
  12. }