Re: [osg-users] PagedLOD - too many nodes

2010-10-23 Thread Tomas Hnilica
Hi Robert, 


 
 However, I think this is probably just a hack around what it
 essentially an issue of poor load balancing in the paged database you
 have built. In essence what you are trying to do when using
 LOD/PagedLOD's is to keep the load on the whole computer to a level
 that the system can handle it comfortably
 


I hope my scene is well balanced. To be exact - The scene is forest of 6 binary 
trees, where each node has Geode with maximum N vertices (ie very similiar 
size, mostly N).  I am not using octrees (mentioned as example), but tetrahedra 
3D space division. The parent node is 50% simplification of its two children. 
So, one pagedLOD has a geometry of size N and reference to the file, where is 
group of 2 pagedLODs, each having geometry of size N, together representing 
higher resolution of parent geometry.
It is implementation of Adaptive TetraPuzzles approach 
(http://www.crs4.it/vic/data/papers/sig2004-tetrapuzzles.pdf)

It's clear, that the goal is to handle constant number of nodes in memory and 
on-screen. My question is, how to find the number since it is hardware 
dependant. Do you think the idea of catching out-of-memory error is a good way? 

Even if I set the max. number of nodes (=geodes, polygons on screen) manually, 
how to manage this? By implementation of some logic in  
osgDB::Registry::ReadFileCallback?
I think the OSG_MAX_PAGEDLOD in conjunction with adjusting pagedLOD::setRange 
can do very similiar job. Maybe with an restriction, that no more than 
OSG_MAX_PAGEDLOD pagedlods will be loaded?

If you think that the model is cube and the multiresolution tree is built on 
the surface, then the tree is good balanced and the only one criteria for 
correct visualization is, when high-res chunks (tiles) replace the low res ones.

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





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


[osg-users] PagedLOD - too many nodes

2010-10-22 Thread Tomas Hnilica
Hi,

I am using osg::PagedLOD nodes in my project for large models visualization. 
The model is splitted into several parts (like octree) and multiresolution tree 
is made - same as VPB uses:


Code:

Group
   PagedLOD
  child 0 - local tile geometry at low resolution
  child 1 - external file reference

   PagedLOD
  child 0 - local tile geometry at low resolution
  child 1 - external file reference





I understand the system of unloading nodes by DatabasePager, when PagedLOD 
nodes count is bigger than OSG_MAX_PAGEDLOD (I hope that unloaded pagedlod 
nodes unload also corresponding data on GPU - when using VBO) 

The system works fine, but the problem is in good PagedLOD::setRangeMode and 
PagedLOD::setRange (between lower res. geode and external reference) data 
setting.  Since my model is not terrain, definition of setRange value is 
crucial. I use PIXEL_SIZE_ON_SCREEN metrics and by low setRange number the high 
resolution files are requested, high number of Geometries is loaded and openGL 
out-of-memory occurs and no new nodes are loaded. The setRange number depends 
on graphical window size, GPU memory, so it should be calculated somehow - to 
get the best performance from hardware.  

Does anyone have tip how to dynamically adjust setRange values? Or is any 
better technique with different metrics?

I have an idea to adjust setRange (or change LODScale) when an out-of-memory 
openGL error occurs. Then I would change the setRange value (it is same for all 
pagedLOD nodes), free the GPU memory and load again. 

What do you think about this idea?
How do I free occupied GPU memory? Is is enough to reconnect the subtree from 
scene?
How do I catch openGL error?

Could culling settings help here to have smaller scene? Culling in my app is 
set to OSG default.

Many thanks in advance, 
Tomas

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





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


Re: [osg-users] PagedLOD - too many nodes

2010-10-22 Thread Robert Osfield
Hi Thomas,

It's possible to adjust the children selection dynamically by
adjusting the Camera::LODScale via
viewer.getCamera()-setLODScale(myScale);.

However, I think this is probably just a hack around what it
essentially an issue of poor load balancing in the paged database you
have built.  In essence what you are trying to do when using
LOD/PagedLOD's is to keep the load on the whole computer to a level
that the system can handle it comfortably.  Think about trying to aim
for a constant number of nodes in memory and on-screen, and constant
number of polygons and textures on screen, we can never attain this
exactly but this is the goal of load balancing.

Using of PagedLOD over LOD allows you to scale higher as you are
no-longer limited by main memory, however, you can still easily build
databases that are too big even for runtime use - if this is the case
then you either have to simplify the children at each LOD range or
make the LOD's ranges more conservative.

With an Octree the potentially for an explosion of nodes and
complexity of the scene is pretty high unless the Octree is sparse,
this keep balancing the books you will have to be prepared to be quite
conservative with your range settings.

There is of course often other ways to solve problems.  Perhaps some
other type of rendering/scene graph approach can held lower the load,
this needn't be in place of paging.  What other techniques might
appropriate I can't say as I know close to nothing about your
application and the type of data you are trying to handle.

Robert.

Robert.

On Fri, Oct 22, 2010 at 5:41 PM, Tomas Hnilica
tomas.hnil...@webstep.net wrote:
 Hi,

 I am using osg::PagedLOD nodes in my project for large models visualization.
 The model is splitted into several parts (like octree) and multiresolution 
 tree is made - same as VPB uses:


 Code:

 Group
   PagedLOD
      child 0 - local tile geometry at low resolution
      child 1 - external file reference

   PagedLOD
      child 0 - local tile geometry at low resolution
      child 1 - external file reference





 I understand the system of unloading nodes by DatabasePager, when PagedLOD 
 nodes count is bigger than OSG_MAX_PAGEDLOD (I hope that unloaded pagedlod 
 nodes unload also corresponding data on GPU - when using VBO)

 The system works fine, but the problem is in good PagedLOD::setRangeMode and 
 PagedLOD::setRange (between lower res. geode and external reference) data 
 setting.  Since my model is not terrain, definition of setRange value is 
 crucial. I use PIXEL_SIZE_ON_SCREEN metrics and by low setRange number the 
 high resolution files are requested, high number of Geometries is loaded and 
 openGL out-of-memory occurs and no new nodes are loaded. The setRange number 
 depends on graphical window size, GPU memory, so it should be calculated 
 somehow - to get the best performance from hardware.

 Does anyone have tip how to dynamically adjust setRange values? Or is any 
 better technique with different metrics?

 I have an idea to adjust setRange (or change LODScale) when an out-of-memory 
 openGL error occurs. Then I would change the setRange value (it is same for 
 all pagedLOD nodes), free the GPU memory and load again.

 What do you think about this idea?
 How do I free occupied GPU memory? Is is enough to reconnect the subtree from 
 scene?
 How do I catch openGL error?

 Could culling settings help here to have smaller scene? Culling in my app is 
 set to OSG default.

 Many thanks in advance,
 Tomas

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





 ___
 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


Re: [osg-users] a ; too many

2008-02-19 Thread Robert Osfield
Thanks for reporting this Anders, this.  The ; was indeed erroneous,
fix a bug, introduce a bug...  I've now removed the ; and checked in
this fix.

On Feb 19, 2008 2:52 PM, Anders Backman [EMAIL PROTECTED] wrote:
 When I build osg from svn today I got the warning:


 .\ParticleSystem.cpp(187) : warning C4390: ';' : empty controlled statement
 found; is this the intent?

 Looks like a feature to me.


  if (currentParticle-getShape() != startParticle-getShape()); 
 {
 startParticle-endRender();
 currentParticle-beginRender();
 startParticle = currentParticle;
  }

 /Anders

 --


 
  Anders Backman   Email:[EMAIL PROTECTED]
  HPC2N/VRlab  Phone:+46 (0)90-786 9936
  Umea university  Cellular: +46 (0)70-392 64 67
  S-901 87 UMEA SWEDEN Fax:  +46 90-786 6126
http://www.cs.umu.se/~andersb
 ___
 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] a ; too many

2008-02-19 Thread Anders Backman
When I build osg from svn today I got the warning:


.\ParticleSystem.cpp(187) : warning C4390: ';' : empty controlled statement
found; is this the intent?

Looks like a feature to me.


 if (currentParticle-getShape() != startParticle-getShape()); 
{
startParticle-endRender();
currentParticle-beginRender();
startParticle = currentParticle;
}

/Anders

-- 



Anders Backman   Email:[EMAIL PROTECTED]
HPC2N/VRlab  Phone:+46 (0)90-786 9936
Umea university  Cellular: +46 (0)70-392 64 67
S-901 87 UMEA SWEDEN Fax:  +46 90-786 6126
  http://www.cs.umu.se/~andersb
___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org