fireball/lib/renderers/shaders/ShaderChunk/fog_fragment.glsl

16 lines
291 B
Plaintext
Raw Normal View History

2018-12-25 13:59:22 +00:00
#ifdef USE_FOG
#ifdef FOG_EXP2
float fogFactor = whiteCompliment( exp2( - fogDensity * fogDensity * fogDepth * fogDepth * LOG2 ) );
#else
float fogFactor = smoothstep( fogNear, fogFar, fogDepth );
#endif
gl_FragColor.rgb = mix( gl_FragColor.rgb, fogColor, fogFactor );
#endif