Hi,
I'll start with my questions first (neccessary context goes later)
- How to achieve equivalent functionality to Producer::Camera::enable ::disable
methods with new osgViewer::Viewer and osg::Camera ?
- Should I use osgViewer::Viewer or rather CompostieViewer for Elumens SPI
rendering ?
Below is larger context for things we want to do. Maybe someone can offer some
advice.
We are porting Elumens SPI rendering code from osgProducer to osgViewer
framework. In our former solution we had one main producer camera for the
viewer and up to six cameras for SPI channels. These SPI cameras where
enabled/disabled when we turned on/off some SPI configuration. Configuration
could change on the fly.
We are now trying to move this code to osgViewer::Viewer with six slave
cameras. But we want these cameras to be inactive on startup and turn them
on/off when needed.
We used Producer::Camera pre & post Draw callbacks to redirect rendering to
Elumens SPI channel render targets. This was bit hacky but worked. Below is a
short description of the process:
For each SPI channel camera:
1 We cached current camera matrices and viewport,
2 Switched to SPI channel (SPIbegin ). SPIbegin adjusted GL matrices/viewport,
3 We read matrices/viewport applied by SPI and used set them Producer::Camera
for OSG scene render.
4 Called update/ frame/ sync to render the scene for the SPI channel
5 Called SPI end to restore GL state
5 Restored original matrices for Producer::Camera
After all SPI channels were rendered final autput Spherical projection was
rendered on main camera render surface (SPIPostRender & SPIFlush)
Whole process wass similar to osgDistortion example with this exception that
Elumens SPI library manages FBO/PBuffer internally. We don't have the access to
these buffers. SPIbegin/SPIend calls pair switches and restores render target.
How should we set up slave cameras to easily fit into this scheme ?
Cheers,
Wojtek Lewandowski
_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/