Re: [osg-users] slow rendering of large quantities of text

2021-04-29 Thread Robert Osfield
Hi Bob,

The performance of creating the labels is an oddity, 5000 labels is quite a
few but surprised it's taking that long.  I don't have any suggestions as
to what is causing things to be so long.

For the type of task you have a general purpose text class like
osgText::Text will not be the most efficient way to implement what you
need.  It will be possible to implement it with custom shaders and
osg::Geometry and use the osgText::Font to provide the Texture.  You can do
a lot of text setup in vertex shader, and even look up glyph coords in the
vertex shader and map an index value to all the glyphs required.

The custom approach will be really light weight but it requires more
knowledge of shaders and how to set everything up in the scene graph, so
it'll be a lot more work.

The most effective use of your time would probably be to profile your
application when it's setting up the text, there could be something
happening that is cause a big bottleneck.  If it turns out the bottleneck
is within the OSG then creating an example that illustrates the bottleneck
would be useful as it'll enable others to try it out and provide insight to
what could be done differently.

Cheers,
Robert.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BXvXZERT2wbNUCGOHhxkUtv_r__DwQkxBK2zSOmKc%3DRRg%40mail.gmail.com.


Re: [osg-users] slow rendering of large quantities of text

2021-04-29 Thread Robert Kiser
Thanks for the quick reply!

1. I believe I am using the release build of OSG, in Release|x64 mode.
2. The labels are just numbers, like: "1", "387", or "5014".  (without the 
quote marks.)  All are unique, corresponding to the number of the point in 
the point cloud.
3. I have tried it with AutoRotateToScreen both true and false.
4. I did not know there was an AutoScale, so am not using that.
5. I am setting: Color, Font, CharacterSizeMode, Alignment, DataVariance, 
and Text.  Anything else is defaulted.
6. I am invoking the text object like so:  osgText::Text* pText = new 
osgText::Text in a function, returning it to the caller as:  
osg::ref_ptr

Does this help any?  Anything else I can do to make the issue clearer?

Thanks in advance for your assistance,

Bob Kiser


On Thursday, April 29, 2021 at 3:47:49 PM UTC-5 robert@gmail.com wrote:

> Hi Bob,
>
> Are you doing your tests with debug or release build of the OSG?
>
> How long are the labels and how what is the range of characters that they 
> labels have?
>
> What properties do you set on the text labels? i.e. autoscale/autorotation 
> etc?
>
> Robert.
>

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/f758d986-0a0c-46f8-b857-d268ef7d1bc1n%40googlegroups.com.


Re: [osg-users] slow rendering of large quantities of text

2021-04-29 Thread Robert Osfield
Hi Bob,

Are you doing your tests with debug or release build of the OSG?

How long are the labels and how what is the range of characters that they
labels have?

What properties do you set on the text labels? i.e. autoscale/autorotation
etc?

Robert.

-- 
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+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/osg-users/CAFN7Y%2BXLk2bW6vHRUDW%2BgpH9vhMLT4r2Qx1OayVRo%2BHg6hnFTQ%40mail.gmail.com.