[osg-users] osg::Billboard positions

OpenSceneGraph Users osg-users at lists.openscenegraph.org
Thu Feb 13 00:03:49 PST 2020


HI Catalin,

I would recommend against deleting and recreating scene graphs on every
frame, this will lead to poor performance.

If you have a really dynamic dataset then it may be appropriate to write a
custom node for this, or use a shader.

In the case of shaders you can often replace billboards with a single
geometry that get instanced and have the
 vertex shader use the index id as a look up into a uniform array that
contains the offsets, or any scales you want.
To change the positions you just update the uniform, to change number you
just change the number of instances.

Robert.

On Wed, 12 Feb 2020 at 20:31, OpenSceneGraph Users <
osg-users at lists.openscenegraph.org> wrote:

> Hi,
>
> I have an issue, might not be related to osg::Billboard it self.
>
> At every frame, I delete all the drawables for a osg::Billboard:
> tags->removeDrawables(0, size);
>
> and I add them again, possible with different values for position:
> tags->addDrawable(osg::Geometry, osg::Vec3(pos.x, pos.y, pos.z));
>
> but in the view I still see the old positions of the tags!
>
> Does OSG has some kind of cache? Do I have to invalidate something?
>
> Greetings,
> Catalin
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200213/748bf4bc/attachment.html>


More information about the osg-users mailing list