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

Reply via email to