Shaders/3dcloud.frag
raw| 1 | #version 120 |
| 2 | |
| 3 | uniform sampler2D baseTexture; |
| 4 | varying float fogFactor; |
| 5 | varying vec4 cloudColor; |
| 6 | |
| 7 | void main(void) |
| 8 | { |
| 9 | vec4 base = texture2D( baseTexture, gl_TexCoord[0].st); |
| 10 | if (base.a < 0.02) |
| 11 | discard; |
| 12 | |
| 13 | vec4 finalColor = base * cloudColor; |
| 14 | gl_FragColor.rgb = mix(gl_Fog.color.rgb, finalColor.rgb, fogFactor ); |
| 15 | gl_FragColor.a = finalColor.a; |
| 16 | } |
| 17 |