easy-osm2city-podman/full/fgdata/Shaders/include_fog.frag
fly fccef75347 Two stage osm2city container build
Signed-off-by: fly <merspieler@airmail.cc>
2023-09-03 16:14:26 +02:00

18 lines
480 B
GLSL

#version 120
//#define fog_FuncTION
//varying vec3 PointPos;
vec3 fog_Func(vec3 color, int type)
{
//if (type == 0){
const float LOG2 = 1.442695;
//float fogCoord =length(PointPos);
float fogCoord = gl_ProjectionMatrix[3].z/(gl_FragCoord.z * -2.0 + 1.0 - gl_ProjectionMatrix[2].z);
float fogFactor = exp2(-gl_Fog.density * gl_Fog.density * fogCoord * fogCoord * LOG2);
if(gl_Fog.density == 1.0)
fogFactor=1.0;
return mix(gl_Fog.color.rgb, color, fogFactor);
}