[osg-users] Cameras with same target and different near/far

Riccardo Corsi riccardo.corsi at kairos3d.it
Fri Jul 10 08:46:36 PDT 2015


Hi all,

what I'm after is a sort of simple depth peeling, the aim is to render 2
different parts of a whole scene with different near/far settings to the
same render target. Something like:

* mainCamera (render the huge surrounding scene)
|
|-- huge scene
|
|-- detailCamera (render a closer object in detail with small z near/far)
      |
      |-- detailed geometry


I thought the best option was to place the detailCamera in scene, to share
the render target, and:
- set a custom near/far settings
- set the clear depth bit
- set the render order to post (or nested?)
but I couldn't get it to work.

I'm particular I have some doubts:
1. does a PRE/POST and a NESTED ORDER camera have the same behavior with
respect to sharing the mainCamera render target, when placed in-scene under
it?
2. for point 1, does anything change if mainCamera renders to the Frame
Buffer or to and FBO?
3. is there any other/more correct way to get 2 cameras to render to the
same FBO with different near/far settings?

Thank you!
Ricky
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20150710/8fee75e6/attachment-0001.htm>


More information about the osg-users mailing list