| 1 |
#version 120 |
| 2 |
|
| 3 |
uniform sampler2D baseTexture; |
| 4 |
varying float fogFactor; |
| 5 |
|
| 6 |
varying vec3 hazeColor; |
| 7 |
|
| 8 |
vec3 filter_combined (in vec3 color) ; |
| 9 |
|
| 10 |
void main(void) |
| 11 |
{ |
| 12 |
vec4 base = texture2D( baseTexture, gl_TexCoord[0].st); |
| 13 |
if (base.a < 0.02) |
| 14 |
discard; |
| 15 |
|
| 16 |
vec4 finalColor = base * gl_Color; |
| 17 |
|
| 18 |
finalColor.rgb = mix(hazeColor, finalColor.rgb, fogFactor ); |
| 19 |
finalColor.rgb = filter_combined(finalColor.rgb); |
| 20 |
|
| 21 |
gl_FragColor.rgb = finalColor.rgb; |
| 22 |
gl_FragColor.a = mix(0.0, finalColor.a, 1.0 - 0.5 * (1.0 - fogFactor)); |
| 23 |
} |
| 24 |
|