vrshoot
annotate sdr/level.p.glsl @ 1:e7ca128b8713
looks nice :)
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sun, 02 Feb 2014 00:35:22 +0200 |
parents | |
children |
rev | line source |
---|---|
nuclear@1 | 1 uniform sampler2D tex; |
nuclear@1 | 2 |
nuclear@1 | 3 varying vec3 vpos; |
nuclear@1 | 4 varying vec2 texcoord; |
nuclear@1 | 5 |
nuclear@1 | 6 void main() |
nuclear@1 | 7 { |
nuclear@1 | 8 vec4 tex = texture2D(tex, texcoord.xy); |
nuclear@1 | 9 |
nuclear@1 | 10 float fog = clamp(40.0 / (vpos.z * vpos.z), 0.0, 1.0); |
nuclear@1 | 11 |
nuclear@1 | 12 gl_FragColor.rgb = tex.rgb * fog; |
nuclear@1 | 13 gl_FragColor.a = tex.a; |
nuclear@1 | 14 } |