Question

Im doing 2D rendering and I'm using FBOs. I need to copy irregular (non square) portion of source FBO to destination FBO.

Is there a way to achieve that by applying some mask?

What I'm doing now:

  1. Copy part of main FBO to temp FBO.
  2. Do some drawing on temp FBO.
  3. glBlitFramebuffer temp FBO back to main FBO stretched.

So, as simplest example, i would like to take round part (or polygon) from main fbo do some drawings on it and blit it back stretched to main FBO. It is like round (or polygonal) magnification glass.

Was it helpful?

Solution

You can use a stencil mask. See this example from the OpenGL wiki: http://www.opengl.org/wiki/Stencil_Mask

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