View Full Version : FBO rendering to specific part of a texture ?

04-07-2010, 09:09 AM

-Is there any way to bins a FBO to a specific area of a texture, not the whole texture ?

-What happen if there's already something in the target texture: can I modify only specific areas, while keeping surrounding texels untouched ?

Ilian Dinev
04-07-2010, 09:17 AM
glViewport, glScissor, or use a stencil.

04-07-2010, 11:00 AM
- Set your viewport to the size of your FBO
- In you vertex shader just pass through the vertex.
- To Draw something (e.g. Rect) within the FBO make sure it is within the canonical viewing region that spans [-1,+1] in all dimensions.
This will preserve your pixels outside of the region you are drawing to.