istereo2
annotate sdr/text.p.glsl @ 35:643f4ab609a4
added readme and license
author | John Tsiombikas <nuclear@member.fsf.org> |
---|---|
date | Sat, 31 Oct 2015 05:45:35 +0200 |
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 vec4 color; |
nuclear@2 | 8 varying vec3 vpos; |
nuclear@2 | 9 varying vec2 tc; |
nuclear@2 | 10 |
nuclear@2 | 11 void main() |
nuclear@2 | 12 { |
nuclear@2 | 13 vec4 tcol = texture2D(tex, tc); |
nuclear@2 | 14 |
nuclear@2 | 15 float fog = exp(-(0.2 * -vpos.z)); |
nuclear@2 | 16 |
nuclear@2 | 17 float alpha = fog * color.a; |
nuclear@2 | 18 |
nuclear@2 | 19 vec4 color = vec4(1.0, 0.3, 0.2, tcol.x * alpha); |
nuclear@2 | 20 |
nuclear@2 | 21 gl_FragColor = color; |
nuclear@2 | 22 } |