Fog.hlsl 357 B

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