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.

有帮助吗?

解决方案

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

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top