1. Create a rectangle from (0,0,0) to (1280,720,0) and UV coordinates from (0,0) to (1,1). Set projection matrix as
Code :
glm::ortho(640,360,1280,720,-1,1);
and no view matrix (identity), which will effectively render the top right corner of the rectangle with UV coordinates from (0.5,0.5) to (1,1) if I use
texture(), which I can use to access the FBO's texture for each pixel to get the correct colour.
gl_FragCoord would only give me coordinates from (0,0) to (640,360) so it's rather useless here. Is this correct?
2. Create a rectangle from (0,0,0) to (1280,720,0) and UV coordinates from (0,0) to (1280,720). Set same matrices as (1) but this time getting UV coordinates from (640,360) to (1280,720) and thus using
texelFetch() to get the correct colour for my pixel. Is this EQUALLY correct? What's the difference between these two approaches, really?
3. I think now it gets overly complicated for no reason: Create a rectangle from (0,0,0) to (1,1,0) and UV coordinates from (0,0) to (1,1). Set projection as
Code :
glm::ortho(0.5,1,0.5,1,-1,1);
which will effectively render the top right corner of the rectangle with UV coordinates from (0.5,0.5) to (1,1). Then using
texture() to get the colour values of the top right corner of the texture attached to the FBO. Is this ALSO correct?