Ignore:
Timestamp:
Nov 19, 2012, 1:45:47 AM (10 years ago)
Author:
sam
Message:

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:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/neercs/video/simple.lolfx

    r1928 r2092  
    33#version 120
    44
     5varying vec2 pass_TexCoord;
     6
    57void main()
    68{
    79    gl_Position = gl_Vertex;
    8     gl_TexCoord[0] = gl_MultiTexCoord0;
     10    pass_TexCoord = vec2(0.5, 0.5) + 0.5 * gl_Vertex.xy;
    911}
    1012
     
    1315#version 120
    1416
     17varying vec2 pass_TexCoord;
     18
    1519uniform sampler2D texture;
    1620
    1721void main(void)
    1822{
    19     gl_FragColor = texture2D(texture, gl_TexCoord[0].xy);
     23    gl_FragColor = texture2D(texture, pass_TexCoord);
    2024}
    2125
Note: See TracChangeset for help on using the changeset viewer.