istereo2
annotate sdr/test.p.glsl @ 30:900651a2f401
foo
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Thu, 08 Oct 2015 06:54:18 +0300 |
parents | |
children |
rev | line source |
---|---|
nuclear@2 | 1 #ifdef GL_ES |
nuclear@2 | 2 precision mediump float; |
nuclear@2 | 3 #endif |
nuclear@2 | 4 |
nuclear@2 | 5 uniform sampler2D tex; |
nuclear@2 | 6 |
nuclear@2 | 7 varying vec3 vpos; |
nuclear@2 | 8 varying vec4 var_color; |
nuclear@2 | 9 varying vec2 var_texcoord; |
nuclear@2 | 10 |
nuclear@2 | 11 void main() |
nuclear@2 | 12 { |
nuclear@2 | 13 vec4 fog_color = vec4(0.6, 0.6, 0.6, 1.0); |
nuclear@2 | 14 |
nuclear@2 | 15 float fog = exp(-(0.2 * -vpos.z)); |
nuclear@2 | 16 |
nuclear@2 | 17 vec4 texel = texture2D(tex, var_texcoord); |
nuclear@2 | 18 texel.w = 1.0; |
nuclear@2 | 19 |
nuclear@2 | 20 vec4 col = var_color * texel; |
nuclear@2 | 21 gl_FragColor = mix(fog_color, col, fog); |
nuclear@2 | 22 } |