changed grid tile and subdued the effect slightly
[vrfileman] / sdr / grid.p.glsl
1 uniform sampler2D tex;
2 uniform vec3 fog_color, grid_color;
3
4 varying vec3 vpos;
5
6 void main()
7 {
8         vec3 texel = texture2D(tex, gl_TexCoord[0].st).xyz;
9         vec3 color = texel * grid_color.r * 2.0;
10
11         float dist = abs(vpos.z);
12         float fog = 1.0 - exp(-dist * 0.12);
13
14         float t = clamp(fog, 0.0, 1.0);
15         gl_FragColor.xyz = mix(color, fog_color, t);
16         gl_FragColor.a = 1.0;
17 }