Hi,

I don't claim this is the ultimate solution, but I've got this piece of hacky code to work around an autotransform limitation when multiple views are present. Maybe you can experiment with it a bit.

I think I originally got it from one of the examples that did some manual terrain paging.

cheers
jp

---8<---

// cull to make sure auto transformed objects have sane bounds
    osg::Camera* camera = view->getCamera();
osgViewer::Renderer* renderer = dynamic_cast<osgViewer::Renderer*>(camera->getRenderer());
    if (renderer)
    {
        osgUtil::SceneView* sceneView = renderer->getSceneView(0);
        sceneView->inheritCullSettings(*(sceneView->getCamera()));
        sceneView->cull();
    }

---8<---


On 10/11/2011 04:18, Christiansen, Brad wrote:
Hi,

I am trying to improve the consistency between the rendering of our
terrain and the objects that interact with it.

What I want to achieve each frame is the following (NB: all objects are
under a single camera):

1) Do the update then cull traversal on the terrain.

- Doing this first allows the rest of the scene to know exactly what
terrain tiles will be used to render the frame. From this I can
determine which areas of the terrain have been changed since the last
frame so I can limit the intersections I need to do to keep objects on
its surface.

2) Do some processing external to the OSG frame loop

- At this stage our application will need to process various functions
based on underlying terrain that are not directly integrated with OSG.

3) Do the update and cull traversals on the rest of the scene.

- The big change in this passes is that during the update traversal the
terrain tiles to be rendered is known. This ensure there is no 'frame
lag' when placing objects a consistent distance on or above the surface
of the terrain.

4) Render the combined result.

At the moment I simply call frame on a Viewer instance.

My first thought was to use node masks at the top of the terrain and
'the rest of the scene' and simply run the update and cull traversals
twice each frame with a different mask. This seems easy to implement for
the update traversals but I cannot see how I can easily implement this
for the cull traversals as both the cull and rendering passes are
implemented by the single ViewerBase::renderingTraversals. Overriding
this function to add the functionality I want seems like a rather
complex problem to tackle.

Is there another, easier way, to get the results I want?

Cheers,

Brad

------------------------------------------------------------------------- 
DISCLAIMER:
This e-mail transmission and any documents, files and previous e-mail
messages attached to it are private and confidential. They may contain
proprietary or copyright material or information that is subject to
legal professional privilege. They are for the use of the intended
recipient only. Any unauthorised viewing, use, disclosure, copying,
alteration, storage or distribution of, or reliance on, this message is
strictly prohibited. No part may be reproduced, adapted or transmitted
without the written permission of the owner. If you have received this
transmission in error, or are not an authorised recipient, please
immediately notify the sender by return email, delete this message and
all copies from your e-mail system, and destroy any printed copies.
Receipt by anyone other than the intended recipient should not be deemed
a waiver of any privilege or protection. Thales Australia does not
warrant or represent that this e-mail or any documents, files and
previous e-mail messages attached are error or virus free.
-------------------------------------------------------------------------



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

--
This message is subject to the CSIR's copyright terms and conditions, e-mail legal notice, and implemented Open Document Format (ODF) standard. The full disclaimer details can be found at http://www.csir.co.za/disclaimer.html.

This message has been scanned for viruses and dangerous content by MailScanner, and is believed to be clean.

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

Reply via email to