Hello,

I've encountered a problem which I#m not able to solve easily.
In my current setup I have to separate the opaque geometry from the transparent ones. For this I set up two RTT-cameras that render to different texture targets and combine them afterwards.
This setup works really fine with near/far plane computation turned off.
Unfortunally this doesn't play well with bigger databases and openflight based terrains (as they use subfaces etc.)

If I setup the first RTT camera to render using near/far plane calculation set to other the DO_NOT_COMPUTE_NEAR_FAR I get wrong results in the transparent pass (or better the combination of transparent and opaque elements doesn't match in depth). My idea why this is going wrong is, that the clampProjectionMatrix is applied at the first render stage only, so I tried to set the projection matrix for the second pass on my own by intercepting the drawCallback. Here it seems I get the unclamped projection matrix. So my second try was to use the ClampProjectionMatrixCallback of the first RTT stage to set the projection. This unfortunately didn't work either.
So I'm a bit lost. Below if tried to give a little overview of the setup.


MainCam
    |
    ___RTT1 (RELATIVE_RF, opaque geometry)
    |
    ___RTT2(RELATIVE_RF, transparent geometry)
    |
__OutCamera(ABSOULTE_RF, Rendertarget = framebuffer, combines the textures written in RTT1 and RTT2)

As far I understand, the RELATIVE_RF will set the same viewpoint and projection as in the main-cam. But what about the near/far computation? I have set it to the main-cam and tried the RTT1 cam aswell, but the projection for the RTT2 pass is just wrong when turning auto near/far computation on

Hope someone can help here.

cheers
Sebastian
_______________________________________________
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to