HI Frederike,

On 6 August 2014 22:03, Friederike Schneemann <
[email protected]> wrote:

> Thank you very much for your quick reply. I didn't know that using
> ShapeDrawables is not recommended at all, but as a beginner it's the first
> which comes across while using google to learn osg :)
>

Curious.  Pretty well every time someone raises issues with ShapeDrawable
on the osg-users/mailing list I recommend AGAINST wide use of
ShapeDrawable, and since this has always been the way since it's inception.
 In the Doxygen docs for the class, provide in the header block is the
statement:

/** Allow the use of <tt>Shape</tt>s as <tt>Drawable</tt>s, so that they can
 *  be rendered with reduced effort. The implementation of \c ShapeDrawable
is
 *  not geared to efficiency; it's better to think of it as a convenience to
 *  render <tt>Shape</tt>s easily (perhaps for test or debugging purposes)
than
 *  as the right way to render basic shapes in some efficiency-critical
section
 *  of code.
 */

I long regret ever writing ShapeDrawable as it's been mis-used so often.
 Perhaps the only way to avoid this over-user/misuse will be to remove it
entirely.



>
> I will maximum place 64 geometry instances (each currently consisting of 3
> ShapeDrawables) in my scene, so I guess either of your suggestions will
> work for me.
>

With only 64 instances then there is absolute no need to worry about memory
consumption, just use separate instances. be that ShapeDrawable or
osg::Geometry.

Robert.
_______________________________________________
osg-users mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

Reply via email to