Re: [osg-users] [vpb] Questions regarding setname, optional layers and layer inheritance

2011-07-07 Thread Christiansen, Brad
Hi,

I haven't done a direct comparison on performance, but the only real overhead 
at tile loading is a small step in deciding which images to load. There are 
more files read from disk as the images are not inline which is probably a 
little slower that reading a single file but I don't think it will effect 
performance much.

From my experience, the biggest hit is the 'unbounded' number of textures 
required to render a single tile. Using the standard approach only a single 
texture exists for each tile. Using optional layers you could theoretically 
have an unlimited number of textures to render to each tile. In theory you 
could even run out of texture units / samplers for each tile (though in 
practice you need a lot of optional layers for this).

Accessing and blending multiple textures will obviously be slower than only 
using one, though I havent noticed much of a performance difference in practice 
when I turn on or off a bunch of optional layers. The other side effect of this 
is complicating the management of the shaders used to render the tile (assuming 
you are not using fixed function). To get good performance on both ATI and 
Nvidia cards I ended up creating a separate shader for all possible number of 
active optional layers and switching between them at run time. this works much 
better than my original approach which used dynamic branching in a single 
shader.

Cheers,

Brad


-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben 
Dannhauer
Sent: Wednesday, 6 July 2011 8:26 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] [vpb] Questions regarding setname, optional layers and 
layer inheritance

Hi Brad,

I realized that I missed a very central question regarding optional layers:

How to they affect the rendering performance? 

Of course it takes some computation time to merge all different layers, but 
have you some hints how the performance is im comparison to a native database 
with all data directly integrated?

Thank you!

Cheers,
Torben

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41191#41191





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


-
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


Re: [osg-users] [vpb] Questions regarding setname, optional layers and layer inheritance

2011-07-07 Thread Torben Dannhauer
Hi Brad,

thanks for the update.

Yesterday I successfully created a database with an optional imagery layer. The 
.dds files were created in the separate folder as desired. With the elevation I 
was not successful, but the question raised what file format would be used for 
the optional elevation layer? I don't think .dds is the appropriate one ;)

Anyway - it seems I was too naive regarding the integration of optional layers. 
I use FFP in my project and I'm still a beginner in shaders, so it will be a 
bumpy way for me to get optional layers working :)
I'll go in the next days through your advices how to display optional layers 
and try to get a basic idea what the main aspects are.

Cheers,
Torben

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41224#41224





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


Re: [osg-users] [vpb] Questions regarding setname, optional layers and layer inheritance

2011-07-07 Thread Christiansen, Brad
Hi,

I also didn't have a lot of luck with external elevation layers, but didn't 
really need them so didn't look into it any further. I am pretty sure that if 
the elevation layers where saved seperately they would simply be an .ive or 
.osgb file with the HeightField layer in it.

Good luck with your investigations. It was quite a long road to get our terrain 
renderer to where it is now.

Cheers,

Brad

-Original Message-
From: osg-users-boun...@lists.openscenegraph.org 
[mailto:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Torben 
Dannhauer
Sent: Thursday, 7 July 2011 2:50 PM
To: osg-users@lists.openscenegraph.org
Subject: Re: [osg-users] [vpb] Questions regarding setname, optional layers and 
layer inheritance

Hi Brad,

thanks for the update.

Yesterday I successfully created a database with an optional imagery layer. The 
.dds files were created in the separate folder as desired. With the elevation I 
was not successful, but the question raised what file format would be used for 
the optional elevation layer? I don't think .dds is the appropriate one ;)

Anyway - it seems I was too naive regarding the integration of optional layers. 
I use FFP in my project and I'm still a beginner in shaders, so it will be a 
bumpy way for me to get optional layers working :)
I'll go in the next days through your advices how to display optional layers 
and try to get a basic idea what the main aspects are.

Cheers,
Torben

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41224#41224





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


-
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


Re: [osg-users] [vpb] Questions regarding setname, optional layers and layer inheritance

2011-07-06 Thread Torben Dannhauer
Hi Brad,

thank you very much for your detailed tips and tricks!

I'll go through it and give you feedback as soon as I can. I'm looking forward 
to write an article in the VPB wiki about the optional layer issue so others 
can dive in that topic with the same help I got from you.

Thank you!

Cheers,
Torben

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41186#41186





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


Re: [osg-users] [vpb] Questions regarding setname, optional layers and layer inheritance

2011-07-06 Thread Torben Dannhauer
Hi Brad,

I realized that I missed a very central question regarding optional layers:

How to they affect the rendering performance? 

Of course it takes some computation time to merge all different layers, but 
have you some hints how the performance is im comparison to a native database 
with all data directly integrated?

Thank you!

Cheers,
Torben

--
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=41191#41191





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


Re: [osg-users] [vpb] Questions regarding setname, optional layers and layer inheritance

2011-07-05 Thread Christiansen, Brad
Hi,

Firstly a tip from building large databases myself, make sure you source 
imagery has been optimised as much as possible. I have found ecw files are much 
faster to process than other formats due to their exceptional speed in creating 
arbitrary overviews. If you are using GeoTiffs make sure you have created 
'overviews' (I cant think of the correct name) for them (basically a set of 
mipmaps stored inline). This make a big difference to generation speed.
I would also suggest you look pay attention to what output format you use for 
your imagery. I have found that compressing the output imagery takes the 
greatest amount of CPU time of the build process. If you use no compression, 
the output will be massive. I use these settings:
--compressed-dxt1a (of dxt1 if my data completely covers the area being 
generated or I am using layer inheritance).
--compression-quality-fastest (I honestly cant see a visible difference 
compared to the high quality mode, but runs almost an order of magnitude faster)
--compressor-nvtt-nocuda (I run on a machine with no or poor graphics card)


Now on to your question regarding options:

--layer-inheritance [Lowest/Nearest/No]
This comes in to play when the source data for a tile does not cover the full 
extents of the tile. This option determines what you see in the 'empty space'.
When set to 'No', the empty space is left empty. If your output format doesn't 
include an alpha channel, the 'empty' space will be black, if your output 
format does support alpha, the empty space will be transparent.
When 'Lowest' is specified, the lowest resolution data available for the area 
if used to fill the gaps.
When Nearest is specified, the nearest resolution data available for the area 
if used to fill the gaps.

Note that when you use optional layers, it really only makes sense to use 'No'.

--set setname
used by itself, I haven't been able to figure out what effect this has.
--optional-set setname
When used in conjunction with --set (i.e. specify both with the same value: 
--set MySet --optional-set MySet) you imagery layer is stored in an external 
(i.e. not in the .ive or .osgb file) directory structure. This allows a tile to 
be loaded without having to load all the optional images associated with it.

--optional-image-layout [inline/external-set-dir/external-local-dir]
--optional-elevation-layout [inline/external-set-dir/external-local-dir]
This determines how optional layers will be written to disk. Using inline 
stores the optional layers within the .ive/.osgb file. These seems to defeat 
the purpose of optional layers but I am probably just missing the use case for 
this.
From my experience both external-set-dir/external-local-dir produce the same 
output, but this may have changed since I last played with these options. I 
think the intention was that external-set-dir places files for each optional 
layer in a folder named after the set, while external-local-dir places all the 
optional layers in a single directory structure. This needs to be confirmed 
though.


 How does the idea of optional layers work? I assume it is possible to plug 
 in optional layers for DEM and for textures independent?
It is, though I haven't personally tried optional elevation data.

 Do I need a special terrain technique to use such a database with optional 
 layers, or can I use the standard osgViewer?
I have written my own terrain technique to control the display of optional 
layers (a sub-class of GeometryTechnique) but I think you can access up to 
three optional layers via a MultiTextureControl node used to decorate the 
generated scene though I haven't used this myself. I am pretty sure the default 
osgViewer doesn't provide access to this functionality though. 
You should also look at the osgTerrain::TerrainTile::setTileLoadedCallback() 
method and the default implementation WhiteListTileLoadedCallback which can be 
used to control the loading of optional layers (I have also implemented my own 
call-back).


I will also add a couple of comments not directly related your questions:

I would suggest you look closely at creating your own TerrainTechnique. 
Subclassing GeometryTechneque is pretty easy and will give you a lot more 
control. While this was quite a bit of work, I have managed to dynamically 
merge the output of multiple VPB databases at runtime. This provides a lot more 
flexibility to 'mix and match' different datasets and greatly simplifies the 
process of adding a bit of new data.

As a side note, once you generate a large database moving it about is very 
painful due to the huge number of small files it creates. To help with this I 
place my databases into an archive format (I think the largest archive I have 
created is ~150gig), though this is probably not practical when your output 
will be several terabytes. If you decide to look into this, a couple of 
pointers / warnings:
- you will need to convert the relative file names for optional layers into 
filenames relative