This post has been de-listed
It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.
glFramebufferTexture2D documentation says:
Special precautions need to be taken to avoid attaching a texture image to the currently bound framebuffer while the texture object is currently bound and potentially sampled by the current vertex or fragment shader. Doing so could lead to the creation of a "feedback loop" between the writing of pixels by rendering operations and the simultaneous reading of those same pixels when used as texels in the currently bound texture. In this scenario, the framebuffer will be considered framebuffer complete, but the values of fragments rendered while in this state will be undefined. The values of texture samples may be undefined as well.
Is it still wrong to use the same texture for input and output if my fragment shader performs a pixel-to-pixel transformation only (so that it was in-place)? For example:
#version 410 core
uniform sampler2D input;
out vec4 result;
void main()
{
ivec2 xy = ivec2(gl_FragCoord.xy);
vec4 val = texelFetch(input, xy, 0);
result = val * val;
}
Subreddit
Post Details
- Posted
- 1 year ago
- Reddit URL
- View post on reddit.com
- External URL
- reddit.com/r/opengl/comm...