Hi,

from the example:

osgTerrain::Terrain* terrain = findTopMostNodeOfType<osgTerrain::Terrain>(rootnode);
        if (!terrain)
        {
            terrain = new osgTerrain::Terrain;
            terrain->addChild(rootnode);

            rootnode = terrain;
        }

        terrain->setSampleRatio(sampleRatio);

jp

Robert Osfield wrote:
Hi David,

If there isn't a Terrain node decorating your terrian just add one,
then add your paged terrain to this.

Also w.r.t distant tiles being rendered at full res, this shouldn't be
happening as VPB generates a hierarchical paged database, with
PagedLOD being the central bit of glue that makes the paging work -
PagedLOD "is a" LOD.   My guess is that everything may well be working
just fine, just your expectations are off.

Also when doing benchmarking of paged database only do it in meshed
mode, as modern drivers render wireframe very slowly compared to
meshed ones.  Wireframe is good just for double checking what the
paging is doing.

As a general note I'd also add the VPB by default does build pretty
high res databases, you can temper this in the original build or at
runtime via the LODScale and SampleRatio, personally I'd recommend the
later as it allows you to trade performance for quality on hardware
that can't handle the high res datasets, but on high end hardware you
can let everything run at full res.

Robert.

On Thu, Feb 26, 2009 at 9:48 AM, David Karlsson <david.karls...@foi.se> wrote:
Hi,

The problem is that I can't find any osgTerrain:Terrain node in the file 
generated by VPB.

The following command always returns NULL:

osgTerrain::Terrain* testNode = 
findTopMostNodeOfType<osgTerrain::Terrain>(terrainNode);

/David


-----Ursprungligt meddelande-----
Från: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] För J.P. Delport
Skickat: den 26 februari 2009 10:20
Till: OpenSceneGraph Users
Ämne: Re: [osg-users] How to use setSampleRatio on terrain generated with VPB?

Hi,

have a look at the osgmultitexturecontrol example. Search for setSampleRatio.

jp

David Karlsson wrote:
Hello,

I'm having problem with my terrain generated using Virtual planet builder. 
Basically, what I want to do is to control the resolution/lod-scale of the 
rendered terrain. If I simply add the node to the scene graph, the terrain is 
rendered using the most detailed lod-level very far away from the camera 
resulting in a lot of unnecessary geometry:

http://www.student.itn.liu.se/~davka531/render_wireframe2.jpg

I found out that I can control this by using setLODScale(...) on the camera, 
but this will unfortunately change the behaviour of all lod-nodes in the scene 
- not only the level of detail of the terrain.

Instead I tried to use setSampleRatio(...) on the terrain node. The problem in 
this case is that I can't find a osgTerrain::Terrain node in the .ive file 
generated from vpb. All I got are osgTerrain::TerrainTile nodes, and I can't 
get the osgTerrain::TerrainTile::getTerrain(...) functions to return a valid 
pointer. What have I missed? Aren't TerrainTiles supposed to be connected to a 
Terrain node?

Some addtional info:

The command used to build the terrain:

osgdem.exe --geocentric --TERRAIN --PagedLOD
--max-visible-distance-of-top-level 200000 --layer 0 -t dir1 --layer 1
-t dir2 --layer 2 -t dir3 -d heightDir -l 10 -o terrain.ive

OSG version: 2.8.0
VPB version: 0.9.9 (revision 953)

Finally, I would like to say thank you to the osg community for helping me out 
with some of my previous posts. Very appreciated!

/David
_______________________________________________
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.  MailScanner thanks Transtec Computers for their 
support.

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

_______________________________________________
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. MailScanner thanks Transtec Computers for their support.

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

Reply via email to