Hi,
Gottfried Gross wrote:
Hi JP,
what I meant is, that I need to call glDrawBuffer (or setDrawBuffer in OSG) to
select the buffer that I want to clear. Sorry, that I did not make it clear.
The following OpenGL code example shows what I want to realize in OSG:
Code:
//for each frame do
id = id mod 2; // Id is switched in[0, 1]
glDrawBuffer(buffers[Id]); // select Buffer
glClearColor( 0.1, 0.2, 0.3,0. 4); // choose color
glClear(GL_COLOR_BUFFER_BIT); // apply color
glDrawBuffer(buffers[2]); // select Buffer
glClearColor(0, 0, 0, 0); // choose color
glClear(GL_COLOR_BUFFER_BIT); // apply color
id += 1;
OK, here is what I would have done. It's probably not the only way, and
I normally tend to using FBOs.
Create a camera for each of the buffers 0-2. Set the clear colour on the
cameras appropriately. Do the swap using an osg::Switch node above the
first two cameras so that only one of them is used per frame (an example
is in osggameoflife).
jp
So I have 3 buffers and want to initialize 2 of them each frame with different
values and also switch one of them each frame. I hope this explains my
problem(s).
Thx,
Gottfried[/code]
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=24023#24023
_______________________________________________
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