glReadPixels from multiple color attachments
I am using deferred shading where I output values to 6 render targets in the fragment shader. I want to fetch all of this data on the CPU side for some processing (ray tracing). How can this be done?
It's all rendered to a FBO with 6 COLOR_ATTACHMENTs.
Quote:Original post by akerlundThis is more OpenGL specific, but when you have an FBO bound (i.e. GL_FRAMEBUFFER_BINDING_EXT is non-zero) you can set the current read buffer to one of the FBO's color attachments...
I am using deferred shading where I output values to 6 render targets in the fragment shader. I want to fetch all of this data on the CPU side for some processing (ray tracing). How can this be done?
It's all rendered to a FBO with 6 COLOR_ATTACHMENTs.
//FBO should be boundglReadBuffer(GL_COLOR_ATTACHMENT0_EXT);glReadPixels(...);glReadBuffer(GL_COLOR_ATTACHMENT1_EXT);glReadPixels(...);//etc... plus error checking
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement