[osg-users] osg::Billboard positions
OpenSceneGraph Users
osg-users at lists.openscenegraph.org
Thu Feb 13 03:50:50 PST 2020
Hi Robert,
I fixed my issue by recreating the osg::Billboard, instead of re-adding all
the drawables to the billboard.
1) tags = new osg::Billboard;
// add all the billboards
2) tags->addDrawable(osg::Geometry, osg::Vec3(pos.x, pos.y, pos.z));
3) draw scene
I understand very well what you are saying, but I don't have time to
understand and create a custom node right now.
We are not using Shaders, the number of tags is very dynamic, however is
less than 100.
Thank you very much,
Catalin
On Thu, 13 Feb 2020 at 10:04, OpenSceneGraph Users <
osg-users at lists.openscenegraph.org> wrote:
> 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
>>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osg-users+unsubscribe at googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osg-users/mailman.70438.1581581043.7167.osg-users-openscenegraph.org%40lists.openscenegraph.org
> <https://groups.google.com/d/msgid/osg-users/mailman.70438.1581581043.7167.osg-users-openscenegraph.org%40lists.openscenegraph.org?utm_medium=email&utm_source=footer>
> .
> _______________________________________________
> osg-users mailing list
> osg-users at lists.openscenegraph.org
> http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
>
> --
> You received this message because you are subscribed to the Google Groups
> "OpenSceneGraph Users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to osg-users+unsubscribe at googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/osg-users/mailman.70438.1581581043.7167.osg-users-openscenegraph.org%40lists.openscenegraph.org
> .
>
--
You received this message because you are subscribed to the Google Groups "OpenSceneGraph Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to osg-users+unsubscribe at googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/osg-users/CAO8T4jKTC1LoadUD9dOe1s8LgCO3X7i_FNarsoGraAzRRdqixA%40mail.gmail.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20200213/e7da3150/attachment.html>
More information about the osg-users
mailing list