[osg-submissions] Move MRT into FBO patch
Robert Osfield
robert.osfield at gmail.com
Wed Apr 16 04:11:53 PDT 2008
On Wed, Apr 16, 2008 at 11:21 AM, J.P. Delport <jpdelport at csir.co.za> wrote:
> > 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.
>
> AFAIK, glDrawBuffers takes only GL_COLOR_ATTACHMENT?_EXT values. You can
> still read back the depth if it is attached. So I think the current code
> is fine.
This is what I assumed, but is a while since I looked at the specs.
> Robert, I'm not sure if you meant "glDrawBuffers" here?
>
> Currently there is no glDrawbuffers call in RenderStage, it is called in
> FBO:apply. However, if we are not using MRT, one should call
> glDrawBuffer at some stage. Currently this choice is made in RenderStage:
Oh I think I'm confusing versions of RenderStage now. You are right
RenderStage no longer has any glDrawBuffers calls.
> if (using mrt)
> fbo->apply (which results in glDrawBuffers)
> else
> glDrawBuffer with buffer as set in member var of RenderStage
>
> So I don't think we can easily get rid of glDrawBuffer as it is
> currently used. glDrawBuffers is only used with fbo's, but glDrawBuffer
> is used in a lot of other combinations in OSG. So setting a default for
> glDrawBuffer in fbo is I think not a good solution.
>
> However, maybe in future refactoring one might move the glDrawBuffer
> call to some other state->apply?
I don't think there is a pressing need to refactor glDrawBuffer, it
works in RenderStage just fine as far as I'm aware.
The issue which is outstanding is the one you raised about resetting
of glDrawBuffers in your own code.
Robert.
More information about the osg-submissions
mailing list