summaryrefslogtreecommitdiff
path: root/src/modules/evas/engines/gl_common/shader_3d/vertex_color_frag.shd
blob: 9b0c023e1bdd3ca1d93ed1ebe73876789b8d6ede (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
varying  vec4        vColor;

#ifdef FOG_ENABLED
uniform float uFogFactor;
uniform vec4  uFogColor;
#endif //FOG_ENABLED

void main()
{
   gl_FragColor = vColor;

#ifdef FOG_ENABLED
   float z = gl_FragCoord.z / gl_FragCoord.w;
   float fogFactor = exp2( -uFogFactor * uFogFactor * z * z * 1.44);
   fogFactor = clamp(fogFactor, 0.0, 1.0);
   gl_FragColor = mix(uFogColor, gl_FragColor, fogFactor);
#endif //FOG_ENABLED

}