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

04-07-2010, 10: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, 10:17 AM
glViewport, glScissor, or use a stencil.

04-07-2010, 12:00 PM
- 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.