[osg-users] What's the difference between put rttcamera under root node and viewer?
Daniel Schmid
daniel.schmid at swiss-simtec.ch
Mon Nov 30 23:52:40 PST 2015
Hi silver
In our project we have a driving simulator using rear view mirrors. And we had the same issues about what should be seen in the mirror and what in the main view. First we had no shadows and light effects in the mirrors, but after some time, we figured that light effects are essential in the mirrors to, but shadows are to expensive...
So we ended up having the following scene graph:
RootNode
- PostProcessingNode
- MainView PreRenderer
- VisualRootNode
- ShadowedScene
- Terrain
- Models
- Particles
- Environment (Sky, Clouds)
- Common PreRenderers (LightMap, Tracks, etc)
So in other words we defined an VisualRootNode that holds all the Content that is common for every viewer (main or mirror). The upper most RootNode contains all the Postpro stuff and Prerenderers that are only for the main view.
Then to render the Mirrors we created PreRender Cameras that are not owned by the scenegraph but share the same GraphicsContext. This is an important Point. They work like the StatsHandler or HelpHandler with their apropriate PostRender Cameras, which never appear in a scene graph but still the use the main GraphicsContext...
These cameras render the VisualRootNode Content to a texture, and this texture can then be applied to a mirror geometry somewhere in our car model.
So there is a decision you have to take what you want to display in the main view and what in the mirrors.
I hope this gave you some ideas.
Now I have a question for you: How did you integrate SpeedTree? Can you provide your implementation? I am working on it, but stuck somehow.You can also write to me personnaly...
Cheers,
Daniel
------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=65803#65803
More information about the osg-users
mailing list