[osg-submissions] Move MRT into FBO patch

Robert Osfield robert.osfield at gmail.com
Wed Apr 16 01:35:11 PDT 2008


HI Art,

On Tue, Apr 15, 2008 at 9:29 PM, Art Tevs <stud_info2 at yahoo.de> wrote:
>  1) I do not know if the draw buffer implementation
>  could also be a non color buffer, i.e. depth or
>  stencil buffer. If yes, then there should be some
>  changes made in the setAttachment method, which do
>  also add non color buffers targets to the _drawBuffers
>  array. However this could be added in later version,
>  if somebody need this.

My tweak to setAttachment simply followed the code that you
had added to apply().  As to whether we should add the other
buffer types, this depends upon the spec.  I'll need to go review
the glDrawBuffers spec.


>  2) I still wonder if one should add something like:
>  glDrawBuffer(default_buffer) in the
>  FrameBufferObject::apply method just right after the
>  line 610:
>  ext->glBindFramebufferEXT(GL_FRAMEBUFFER_EXT, 0);
>
>  which will restore the default draw buffer if user
>  ment to have this. Otherwise I still do not understand
>  how the previous draw buffer get restored after
>  applying an fbo.

One either needs to a glDrawBuffers() with the default in this
instance or when you apply a FBO without its own glDrawBuffers
call it should call glDrawBuffers with the default.  Personally I
feel that doing the later is more efficient as it'll involve less
thrashing of the glDrawBuffers.

>  All current implementations/examples do only work
>  because there is a call to glDrawBuffer in the
>  RenderStage class, which do set the default buffer
>  just right before rendering. However if I am for
>  example not using any RenderStage to render, then
>  there will be no setting to default buffer.

Could we remove this glDrawbuffers call from RenderStage
and find out?

Robert.


More information about the osg-submissions mailing list