Hi,
Guy wrote:
> Hi,
> Since the change I suggest is very small from what JP has implemented I
> don't submit files here just the differences:
>
> I removed getDrawBuffers and setDrawBuffers from the Camera.cpp / h
>
>
> In RenderStage the changes are as follows:
> RanderStage //.h
> Added vector of GLEnum named _drawBuffers.
>
> RenderStage.cpp
> In function runCameraSetUp, before the attachments loop (line 245)
> _drawBuffers.clear();
> In the loop, add at the start of the loop the few lines:
>
> if(itr->first >= COLOR_BUFFER0 && itr->first <=
> COLOR_BUFFER7)
> _drawBuffers.push_back(itr->first -
> COLOR_BUFFER0 +
> GL_COLOR_ATTACHMENT0_EXT);
>
> And removed the line JP added (about line 404)
>
>
> // set up draw buffers if using multiple render targets
> osg::Camera::DrawBufferVector& cam_buffers =
> _camera->getDrawBuffers();
> _drawBuffers.clear();
> for (osg::Camera::DrawBufferVector::iterator buf =
> cam_buffers.begin();
> buf != cam_buffers.end();
> ++buf)
> {
>
> _drawBuffers.push_back(GL_COLOR_ATTACHMENT0_EXT+(*buf -
> osg::Camera::COLOR_BUFFER0));
> }
>
> Then in function drawInner, in the second line JP wrote:
>
> bool using_multiple_render_targets = !(_drawBuffers.empty());
>
> I changed it to
> bool using_multiple_render_targets = (_drawBuffers.size() > 1);
>
> That's all the changes. So if JP can check it (I have a mess of OSG1.2
> and OSG2.3 code) then you can decide what to submit.
The newest submission is essentially what you have above, but the change
Robert made to the attachment enum allows empty to still work properly.
The vector is also automatically only populated for > COLOR0.
cheers
jp
> Thanks,
> Guy.
>
> _______________________________________________
> osg-users mailing list
> [email protected]
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
--
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-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org