Question

I've have a rendering setup in which I write to a Frame Buffer object attached to a texture and the rendering itself also uses the texture I'm rendering to.
Is this generally a good idea? Could there be some strange issues involved here I'm perhaps not aware of?

Was it helpful?

Solution

This will result in undefined behavior, which means it may break with any future driver version, and behave differently on different hardware. To be on the safe side, you should never render into a texture which is currently bound (i.e. which could be possibly read and written to at the same time -- this is the problem actually). Try making a copy of the texture, and render into that instead.

Take a look at the spec, specifially section 4.4.3 "Rendering When an Image of a Bound Texture Object is Also Attached to the Framebuffer"

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top