-
I am working on a render-to-texture magnifying glass and stumbled on some code playing with the camera render order and render bins. However I didn't find some good documentation on it. I have a few question about it:
More generally, where can I find this kind of documentation? I found nothing on the website knowledge base and the OpenSceneGraph cookbook doesn't give a lot of details. I am using OSG 3.6.4. Thanks for your help. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
For render-to-texture you want the render the subgraph for it before the main scene, which is set by PRE_RENDER. Have a look through the examples that do render to texture and you'll see a setting for PRE_RENDER. For instance these are the examples that use PRE_RENDER (it's used for me than just render-to-texture.):
|
Beta Was this translation helpful? Give feedback.
-
After some trial and error, I think I understand the algorithms now. It looks like this:
Each camera does a "render", which includes all the render bins of its childs. So the interaction between camera render order and render bins order looks like "for each camera { for each render bin }". Important: the nested cameras (i.e. in the scene graph) render order do not count in the overall camera sorting, only in the currently nesting camera. That is, given a "POST_RENDER 2" main camera, a camera PRE_RENDER will be rendered before, and a PRE_RENDER nested camera will be rendered after, even if it has a smaller render order num. |
Beta Was this translation helpful? Give feedback.
After some trial and error, I think I understand the algorithms now. It looks like this:
GraphicsContext
(which usually are the main and slave camera of the currentViewer
), sorted by RenderOrder and RenderOrder num: