FBO rendering to specific part of a texture ?


-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 ?

glViewport, glScissor, or use a stencil.

  • 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.