examples/data/ex_shader_multitex_pixel.glsl
raw| 1 | /* Simple fragment shader which uses the fractional texture coordinate to |
| 2 | * look up the color of the second texture (scaled down by factor 100). |
| 3 | */ |
| 4 | #ifdef GL_ES |
| 5 | precision mediump float; |
| 6 | #endif |
| 7 | uniform sampler2D al_tex; |
| 8 | uniform sampler2D tex2; |
| 9 | varying vec2 varying_texcoord; |
| 10 | void main() |
| 11 | { |
| 12 | vec4 color = texture2D(tex2, fract(varying_texcoord * 100.0)); |
| 13 | gl_FragColor = color * texture2D(al_tex, varying_texcoord); |
| 14 | } |