Hey, when I render the screen to an offscreen buffer for downsampling or storage for later it gets offset.
I noticed it when I was writing a wide radius bloom shader as the offset increased after every downsample and blur making it more and more noticeable.
im using opengl and have GL_LINEAR enabled for the offscreen buffer and the viewport size is 1024x1024 with the offscreen buffer matching that.
Shouldnt the offscreen buffer match the main exactly pixel for pixel if its not being resized or is this a side effect of using gl_linear?.
Heres the frag but it just passes through the color which gets sent to the next pass as an input.
uniform sampler2D ColorTexture;
uniform vec2 buffer_res;
vec2 texel = 1.0 / buffer_res;
vec2 texCoord = gl_TexCoord[0].xy;
void main() {
// with this the offset pushes out from the center rather than off to the top right corner
// but is still getting offset
texCoord += vec2(0.5, 0.5) * texel;
gl_FragColor.rgb = textureLod(bgl_RenderedTexture, texCoord, 0).rgb;
}
The images are crops from 1024x1024