[osg-users] How do cameras handle the render target?

Werner Modenbach Werner.Modenbach at texion.eu
Wed Mar 15 02:56:35 PDT 2017

Hi all.

I have a problem understanding how cameras handle render targets.
My special case:
I have a standard camera on a view.
The root node of the scene is a group with the following children:

- my model
- hud camera for wallpaper
- hud camera for text
- more cameras for special cases

All the cameras are children of the group node and do POST_RENDER operation.

I need snapshots of the complete scene from various camera positions.
What I do:





Then I do snapshots with the modified projection matrix of the camera.
After each snapshot I read the contents of the fbImage.

I reset everything to the initial status by:




Unfortunately the fbImage always only contains my model but not the 
child cameras renderings.
Attaching the fbImage to the child cameras as well gives me just a black 
Of course the child cameras do not clear the color buffer.

What is the proper way of receiving the complete rendering? I also tried 
installing a slave camera to the main camera but that also gives me only 
the rendered model.
And rendering to the fbImage by installing an additional child camera 
with POST_RENDER instead
of a slave camera leads to the same result.

Rendering to screen is perfect, but to fbImage is not.
It seems I'm blind on some basic functionality and all my research 
doesn't open my eyes.

I instantly hope for some help.


- Werner -
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20170315/aee880eb/attachment-0002.htm>

More information about the osg-users mailing list