Subversion Repository Public Repository

Divide-Framework

This repository has no backups
This repository's network speed is throttled to 100KB/sec

Diff Revisions 167 vs 168 for /trunk/assets/shaders/GLSL/fragmentAtoms/fog.frag

Diff revisions: vs.
  @@ -1,4 +1,4 @@
1 - uniform bool enableFog = true;
1 + uniform bool dvd_enableFog = true;
2 2 uniform float fogStart;
3 3 uniform float fogEnd;
4 4 uniform float fogDensity;
  @@ -7,13 +7,14 @@
7 7 uniform vec3 fogColor;
8 8
9 9 const float LOG2 = 1.442695;
10 - float zDepth = gl_FragCoord.z / gl_FragCoord.w;
11 10
12 11 void applyFog(inout vec4 color){
13 - if(!enableFog) return;
12 + if(!dvd_enableFog)
13 + return;
14 14
15 - float fogFactor = exp2( -fogDensity * fogDensity * zDepth * zDepth * LOG2 );
16 - fogFactor = clamp(fogFactor, 0.0, 1.0);
17 - color.rgb = mix(fogColor, color.rgb, fogFactor);
15 + float zDepth = gl_FragCoord.z / gl_FragCoord.w;
16 + color.rgb = mix(fogColor,
17 + color.rgb,
18 + clamp(exp2( -fogDensity * fogDensity * zDepth * zDepth * LOG2 ), 0.0, 1.0));
18 19
19 20 }