hello,
is there a difference between these two methods
accessing a texture ?
uniform sampler2D texImage;
uniform vec2 inv_screen; // inverse of screensize (1/x, 1/y)
in vec3 gs_TexCoord;
out vec4 gs_FragColor;
void main(void)
{
//method a
gs_FragColor = texture2D(texImage, gs_TexCoord);
// method b
gs_FragColor = texture2D(texImage, gl_FragCoord.xy * inv_screen);
}
for me there is no difference in method a and b. both texture
coordinates are in the range [0,1]. So I sometimes
read method b in some tutorials. Is there a reason for method b or does it just depends on the mood of the programmer ?
regards,
lobbel