OpenGL2: Remove AGEN_FRESNEL(superceded by cubemap patch), and some small fixes and optimizations.
This commit is contained in:
parent
82be4e667f
commit
acbeca6042
8 changed files with 157 additions and 213 deletions
|
@ -85,13 +85,13 @@ float CalcFog(vec4 position)
|
|||
float s = dot(position, u_FogDistance) * 8.0;
|
||||
float t = dot(position, u_FogDepth);
|
||||
|
||||
bool eyeOutside = u_FogEyeT < 0.0;
|
||||
float t2 = float(t >= float(eyeOutside));
|
||||
float eyeOutside = step(0.0, -u_FogEyeT);
|
||||
float fogged = step(eyeOutside, t);
|
||||
|
||||
t = max(t, 1e-6);
|
||||
t *= fogged / (t - u_FogEyeT * eyeOutside);
|
||||
|
||||
if (eyeOutside)
|
||||
t2 *= t / (t - u_FogEyeT);
|
||||
|
||||
return s * t2;
|
||||
return s * t;
|
||||
}
|
||||
|
||||
void main()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue