سؤال

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