Hi Guy,
I guess I could have been a little clearer in my description. So here's an
example that should help:
You're right, the description you gave this time makes things a lot clearer.
The camera will only clear its viewport. And that makes sense, since the
camera should only ever affect pixels inside its viewport...
Even though after swap buffers, the context's clear() method is called
as you've seen (good that you went to look at the code BTW, great
initiative), the context does not do any clear because, as you can see
in the doc of GraphicsContext::setClearMask() :
"Set the clear mask used in glClear(). Defaults to 0 - so no clear is
done by default by the GraphicsContext, instead the Camera's attached
the GraphicsContext will do the clear. GraphicsContext::setClearMask()
is useful for when the Camera's Viewports don't conver the whole
context, so the context will fill in the gaps."
So there you have it, a solution to your problem :-)
(note, "[...] the Camera's attached the GraphicsContext [...]" should
read "[...] the Cameras attached to the GraphicsContext [...]", I should
probably submit that correction to Robert :-) )
Note that if you set the context's clear mask to a non-zero value, you
could then set the camera's clear mask to 0. No sense in clearing the
whole context, and then clearing the camera's viewport a second time...
Unless you want them cleared to a different color, or to clear different
parts of the buffer.
Hope this helps,
J-S
--
______________________________________________________
Jean-Sebastien Guay [email protected]
http://www.cm-labs.com/
http://whitestar02.webhop.org/
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org