Re: [osg-users] Dynamic HeightField

2013-02-11 Thread bilal zeidan
Hi,

Thanks, that's what I did after investegating this issue. 

Thank you!

Cheers,
bilal

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





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


Re: [osg-users] Dynamic HeightField

2013-01-24 Thread Thrall, Bryan
bilal zeidan wrote on 2013-01-07: 
 Hi, I tried to create a dynamic heightField by attaching a heightField
 Shape drawable into a Geode node, and then I called the
dirtyDisplayList
 on each frame. I noticed that the frame rate drop a lot when the HF is
 quite big ( 200 x 200 ). I did the same test by using a drawable of
type
 geom and I get a better perforamance.

Display lists are best for drawables that do not change; if you are
updating the height field every frame, you will probably get better
performance by turning off display lists.

Hope this helps,
--
Bryan Thrall
Principal Software Engineer
FlightSafety International
bryan.thr...@flightsafety.com


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


Re: [osg-users] Dynamic HeightField

2013-01-24 Thread Robert Osfield
Hi Bilal,

The osg::ShapeDrawable is not meant for heavy usage, an certainly not
dynamic height fields so isn't the tool to use, the ShapeDrawable is
really just a quick a dirty mechanism for drawing shapes.

One could possible use osgTerrain, it'd generally better than
ShapeDrawable is it's more scalable and designed for performance.
However, it's still designed around the concept of static height
fields.

If you want to do a dynamic height field then I would suggest thinking
about using vertex shaders and provide the heights as a vertex
attribute array composed of a FloatArray.  osg::Geometry and
osg::StateSet/osg::Program all provide the low level tools you need to
do this, but you'll need to brush up a bit more on lower level OSG
functioanlity like shaders and meshes.  Have a look at the osgshader,
osggeometry and osgparameter examples for inspiration.

Robert.

On 7 January 2013 18:04, bilal zeidan bilal.zei...@simlog.com wrote:
 Hi,
 I tried to create a dynamic heightField by attaching a heightField Shape 
 drawable into a Geode node, and then I called the dirtyDisplayList on each 
 frame. I noticed that the frame rate drop a lot when the HF is quite big ( 
 200 x 200 ). I did the same test by using a drawable of type geom and I get a 
 better perforamance.

 My questions are the follow:
  1- What is the best to create a dynamic heightField?
  2- Is there any optimal way to update the heights of a given heightField
  shape. I did this attempt osg::HeightField::getFloatArray()-dirty()
  but it didn't update the heights.
  3- What about the use of osg::Terrain/osg::TerrainTile to create a
  dynamic heightField?  Is it a better alternative in term of perforamce?

 Thank you!

 Cheers,
 bilal

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





 ___
 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