Hi, I want to revive this relatively old thread.
Can someone help me with the problem? I wasn't able to solve it.
Setting the projection matrix of the PreRender2-pass in a cull callback doesn't help really.

The problem behind this, is simply the fact, that the PreRender2-pass has a different scene(or at least a different cullmask) and will compute the incorrect near/far values. So I really need the near/far computation to be done by the first pass and used by the second pass.

cheers
Sebastian
Hi folks,

In my deferred setup I have multiple cameras rendering different subgraphs of the scene.

Setup is more or less like this:

MainCamera
    |
    PreRender1 - RELATIVE_RF(Gbuffer)
    |
    PreRender2- RELATIVE_RF(Transparent objects)
    |
    PreRender3 - ABSOLUTE_RF (SSAO)
    |
    ...
    |
    OutCamera - ABSOLUTE_RF (FullScreen Quad)
The cameras are all rendering to framebuffer rendertargets and setup their render order as in the diagram above.


This works really fine as long as I use setComputeNearFarMode(osg::CullSettings::DO_NOT_COMPUTE_NEAR_FAR); If I switch to any other mode in the PreRender1 the other cameras seem to use their original near/far. I already tried to set the projection matrix of the other cameras in a cull-callback (on the main and on the PreRender1) but it seems after the cullvisitor has traversed the projection-Matrix of the camera still shows the same near far planes. Also I tried to install a ClampProjectionMatrixCallback to the MainCamera. This worked, but unfortunally with the same result. The projection is indeed clamped, but it is not applied to the other relative cameras. The last hours I tried to play around with the inheritance masks of the cameras but this didn't help in any way.

Any Idea what I'm doing wrong here?
Also could someone explain to me what the difference between the PreRender and the NestedRender are in this setup?

cheers
Sebastian

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to