[osg-submissions] Multiple RTT support
Robert Osfield
robert.osfield at gmail.com
Mon Oct 1 08:45:39 PDT 2007
Hi Guys,
I tried the below but still get errors. I'm afraid I don't have time
to go debugging what is effectively a half backed submission.
Could you all review the submission and get it working. Without
errors when running standard examples like:
osgviewer cow.osg --3d-sd
osgviewer cow.osg --panoramic-sd
osgprerender cow.osg
Right now I'm revert all changes related to this submission and
sticking to the standard SVN version of these code.
Robert.
On 10/1/07, Robert Osfield <robert.osfield at gmail.com> wrote:
> Hi Guys,
>
> I'm just trying out changed include/osg/Camera BufferComponent definition to:
>
> enum BufferComponent
> {
> DEPTH_BUFFER = GL_DEPTH_ATTACHMENT_EXT,
> STENCIL_BUFFER = GL_STENCIL_ATTACHMENT_EXT,
> COLOR_BUFFER = GL_COLOR_ATTACHMENT0_EXT,
> COLOR_BUFFER0 = COLOR_BUFFER,
> COLOR_BUFFER1 = COLOR_BUFFER+1,
> COLOR_BUFFER2 = COLOR_BUFFER+2,
> COLOR_BUFFER3 = COLOR_BUFFER+3,
> COLOR_BUFFER4 = COLOR_BUFFER+4,
> COLOR_BUFFER5 = COLOR_BUFFER+5,
> COLOR_BUFFER6 = COLOR_BUFFER+6,
> COLOR_BUFFER7 = COLOR_BUFFER+7
> };
>
> And use this value directly in the glReadBuffer() parameter.
>
> I'm waiting for a complete build before checking in.
>
> Robert.
>
> On 10/1/07, J.P. Delport <jpdelport at csir.co.za> wrote:
> > Hi Robert/John,
> >
> > I'm sorry I don't have time to work on this. I'm attaching an email from
> > Mauricio below where he also had some problem with retrieving the depth
> > buffer after using some of my changes, maybe this can help.
> >
> > jp
> >
> > --------------------------------8<---
> >
> > Hi JP
> >
> > Thank you very much for your help.
> >
> > In fact, we both have been working around the same piece of code. That
> > "_bufferAttachmentMap" and the work around it had to be created by me,
> > some months ago, because before of that you could only retrieve one
> > buffer to CPU (color or depth buffer, the last requested, if I remember).
> >
> > Now I can retrieve to CPU as many color buffers I need and the depth
> > buffer too. But I had to make a little modification in your code.
> > Although I could retrieve the depth buffer, the following error was
> > issued to console:
> >
> > Warning: detected OpenGL error 'invalid enumerant' after
> > RenderBin::draw(,)
> > RenderStage::drawInner(,) FBO status= 0x8cd5
> >
> > It was because the FBO extension enumeration does not match with
> > osg::camera::BufferComponent enumeration. While DEPTH_BUFFER is in the
> > beginning of osg::camera, GL_DEPTH_ATTACHMENT_EXT is in the end of FBO.
> > This way, an invalid parameter was passed to glReadBuffer().
> >
> > So I had to change the line
> >
> > glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + (itr->first -
> > osg::Camera::COLOR_BUFFER0));
> >
> > by this code
> >
> > int attachment=itr->first;
> > if (attachment==osg::CameraNode::DEPTH_BUFFER){
> > glReadBuffer(GL_COLOR_ATTACHMENT0_EXT);
> > }
> > else
> > {
> > glReadBuffer(GL_COLOR_ATTACHMENT0_EXT + (attachment -
> > osg::CameraNode::COLOR_BUFFER0));
> > }
> >
> > Witch is far from clean but solved my problem.
> >
> > Again, thank you very much.
> >
> > Mauricio Hofmam
> > hofmam at tecgraf.puc-rio.br
> >
> > --------------------------------8<---
> >
> > Robert Osfield wrote:
> > > Hi John,
> > >
> > > I've just applied your changes and osgprerender still works fine but when I run:
> > >
> > > osgviewer cow.osg --3d-sd
> > >
> > > And
> > >
> > > osgviewer cow.osg --panoramic-sd
> > >
> > > I get the error:
> > >
> > > Warning: detected OpenGL error 'invalid operation' after RenderBin::draw(,)
> > > RenderStage::drawInner(,) FBO status= 0x8cd5
> > >
> > > I haven't had a chance to look into this, its an error that didn't
> > > occur before. The above viewer options use render to texture to do
> > > distortion correction for a spherical display.
> > >
> > > Robert.
> > > On 10/1/07, John Donovan <john.donovan at embryonicstudios.com> wrote:
> > >> Hi Robert,
> > >> With code first written by J.P. Delport, I've made the necessary changes to
> > >> allow for multiple render to texture, and read from texture. By attaching more
> > >> than one buffer to a camera, it automatically calls glDrawBuffers() if it's
> > >> supported, otherwise it falls back to glDrawBuffer().
> > >> If images are attached to a camera, it automatically reads the texture into the
> > >> image. I've not put in any support to switch this on and off on the fly, but I
> > >> can do that if you want.
> > >> I've tested all the codepaths on Windows with an nVidia card, and it all seems
> > >> shiny. But I don't have a Linux box or ATI card to test it any further.
> > >>
> > >> Kindest regards,
> > >> John Donovan
> >
> > --
> > This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard.
> > The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.
> >
> > This message has been scanned for viruses and dangerous content by MailScanner,
> > and is believed to be clean. MailScanner thanks Transtec Computers for their support.
> >
> > _______________________________________________
> > osg-submissions mailing list
> > osg-submissions at lists.openscenegraph.org
> > http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org
> >
>
More information about the osg-submissions
mailing list