source: trunk/tools/neercs/video/simple.lolfx @ 2277

Last change on this file since 2277 was 2092, checked in by sam, 8 years ago

neercs: do not pass the texture coordinates from the application to
the GL server; instead, simply deduce them from the vertex coordinates
and interpolate them in the fragment shader.

File size: 318 bytes
Line 
1[vert.glsl]
2
3#version 120
4
5varying vec2 pass_TexCoord;
6
7void main()
8{
9    gl_Position = gl_Vertex;
10    pass_TexCoord = vec2(0.5, 0.5) + 0.5 * gl_Vertex.xy;
11}
12
13[frag.glsl]
14
15#version 120
16
17varying vec2 pass_TexCoord;
18
19uniform sampler2D texture;
20
21void main(void)
22{
23    gl_FragColor = texture2D(texture, pass_TexCoord);
24}
25
Note: See TracBrowser for help on using the repository browser.