OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Vanishing letters in osg::Text


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General
View previous topic :: View next topic  
Author Message
Tim Hartter
Guest





PostPosted: Sat Apr 22, 2017 10:21 am    Post subject:
Vanishing letters in osg::Text
Reply with quote

Hello everyone, I have a problem with osg::Text()
Some letters seem to vanish with depth (see picture) - the "h" in "This is a label.." is vanishing if the text is further away from the camera.

Do you have any idea what I'm doing wrong?

This is how I draw the text node: (the font does not matter by the way...)
Quote:
osg::ref_ptr<osg::StateSet>pStateset(newosg::StateSet());

pStateset->setMode(GL_LIGHTING,
osg::StateAttribute::OFF|
osg::StateAttribute::PROTECTED|
osg::StateAttribute::OVERRIDE);

pStateset->setMode(GL_BLEND,osg::StateAttribute:ShockedN);
pStateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
pStateset->setRenderBinDetails(INT_MAX,"RenderBin",osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);

osg::ref_ptr<osgText::Text>pText(newosgText::Text);
osg::ref_ptr<osg::Geode>pTextGeode(newosg::Geode);
pText->setFont(pFont);
pText->setText(Text.c_str());
pText->setAutoRotateToScreen(true);
pText->setDrawMode(osgText::Text::TEXT|osgText::Text::FILLEDBOUNDINGBOX);
pText->setBoundingBoxMargin(FontSize*0.1);
pText->setFontResolution(96,96);
pText->setCharacterSize(FontSize);
pText->setPosition(Position);
pText->setColor(osg::Vec4d(1,0,0,1));
pText->setStateSet(pStateset.get());
pText->setUseDisplayList(false);

pTextGeode->addDrawable(pText);
pTextGeode->setStateSet(pStateset);
returnpTextGeode;


I'd be greatful for any help on the matter.
-Tim-

------------------
Post generated by Mail2Forum
Back to top
mp3butcher (Julien Valentin)
Appreciator


Joined: 17 Feb 2010
Posts: 297

PostPosted: Sat Apr 22, 2017 4:12 pm    Post subject:
Re: Vanishing letters in osg::Text
Reply with quote

Hi
I'm not really an osg::Text master but my guess is the osg::Text is not mean to be used with a explicit transparent stateset.
You should try to modify the osgText example in order to diagnoze this and tell me if my guess is right.

Cheers

Tim Hartter wrote:
Hello everyone, I have a problem with osg::Text()
Some letters seem to vanish with depth (see picture) - the "h" in "This is a label.." is vanishing if the text is further away from the camera.

Do you have any idea what I'm doing wrong?

This is how I draw the text node: (the font does not matter by the way...)
Quote:
osg::ref_ptr<osg::StateSet>�pStateset(new�osg::StateSet());

pStateset->setMode(GL_LIGHTING,
osg::StateAttribute::OFF�|
osg::StateAttribute::PROTECTED�|
osg::StateAttribute::OVERRIDE);

pStateset->setMode(GL_BLEND,�osg::StateAttribute:ShockedN);
pStateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
pStateset->setRenderBinDetails(INT_MAX,�"RenderBin",�osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);

osg::ref_ptr<osgText::Text>�pText(�new�osgText::Text�);
osg::ref_ptr<osg::Geode>�pTextGeode�(�new�osg::Geode�);
pText->setFont(pFont);
pText->setText(Text.c_str());
pText->setAutoRotateToScreen(true);
pText->setDrawMode(osgText::Text::TEXT�|�osgText::Text::FILLEDBOUNDINGBOX);
pText->setBoundingBoxMargin(FontSize�*�0.1);
pText->setFontResolution(96,�96);
pText->setCharacterSize(FontSize);
pText->setPosition(Position);
pText->setColor(osg::Vec4d(1,0,0,1));
pText->setStateSet(pStateset.get());
pText->setUseDisplayList(false);

pTextGeode->addDrawable(pText);
pTextGeode->setStateSet(pStateset);
return�pTextGeode;


I'd be greatful for any help on the matter.
-Tim-

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10989

PostPosted: Sat Apr 22, 2017 5:29 pm    Post subject:
Vanishing letters in osg::Text
Reply with quote

Hi TIm,

It's to know what might be wrong from the description, my best guess
is that it might be some depth buffer resolution issue. Could it be
the filled bounding box that is t fault? Try not enabling this and see
what happens.

Robert.

On 22 April 2017 at 11:18, Tim Hartter <> wrote:
Quote:
Hello everyone, I have a problem with osg::Text()
Some letters seem to vanish with depth (see picture) - the "h" in "This is a
label.." is vanishing if the text is further away from the camera.

Do you have any idea what I'm doing wrong?

This is how I draw the text node: (the font does not matter by the way...)

osg::ref_ptr<osg::StateSet> pStateset(new osg::StateSet());

pStateset->setMode(GL_LIGHTING,
osg::StateAttribute::OFF |
osg::StateAttribute::PROTECTED |
osg::StateAttribute::OVERRIDE);

pStateset->setMode(GL_BLEND, osg::StateAttribute:ShockedN);
pStateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
pStateset->setRenderBinDetails(INT_MAX, "RenderBin",
osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);

osg::ref_ptr<osgText::Text> pText( new osgText::Text );
osg::ref_ptr<osg::Geode> pTextGeode ( new osg::Geode );
pText->setFont(pFont);
pText->setText(Text.c_str());
pText->setAutoRotateToScreen(true);
pText->setDrawMode(osgText::Text::TEXT |
osgText::Text::FILLEDBOUNDINGBOX);
pText->setBoundingBoxMargin(FontSize * 0.1);
pText->setFontResolution(96, 96);
pText->setCharacterSize(FontSize);
pText->setPosition(Position);
pText->setColor(osg::Vec4d(1,0,0,1));
pText->setStateSet(pStateset.get());
pText->setUseDisplayList(false);

pTextGeode->addDrawable(pText);
pTextGeode->setStateSet(pStateset);
return pTextGeode;


I'd be greatful for any help on the matter.
-Tim-






------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Tim Hartter
Guest





PostPosted: Sat Apr 22, 2017 9:55 pm    Post subject:
Vanishing letters in osg::Text
Reply with quote

Hi Robert,

I have been playing around with different settings. Changing the bounding
box did not solve the problem.

Strangely setting a style with depth 0.1 solves the problem if I connect
via Remote Desktop. Not assigning any font solves tge problem completely -
the text is just not pretty anymore.

Can you tell me if you are using any special fallback settings in case no
font is assigned to osg::text?

Tim




Mit AquaMail Android
http://www.aqua-mail.com gesendet


Am 22. April 2017 7:25:33 nachm. schrieb Robert Osfield
<>:

Quote:
Hi TIm,

It's to know what might be wrong from the description, my best guess
is that it might be some depth buffer resolution issue. Could it be
the filled bounding box that is t fault? Try not enabling this and see
what happens.

Robert.

On 22 April 2017 at 11:18, Tim Hartter <> wrote:
Quote:
Hello everyone, I have a problem with osg::Text()
Some letters seem to vanish with depth (see picture) - the "h" in "This is a
label.." is vanishing if the text is further away from the camera.

Do you have any idea what I'm doing wrong?

This is how I draw the text node: (the font does not matter by the way...)

osg::ref_ptr<osg::StateSet> pStateset(new osg::StateSet());

pStateset->setMode(GL_LIGHTING,
osg::StateAttribute::OFF |
osg::StateAttribute::PROTECTED |
osg::StateAttribute::OVERRIDE);

pStateset->setMode(GL_BLEND, osg::StateAttribute:ShockedN);
pStateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);
pStateset->setRenderBinDetails(INT_MAX, "RenderBin",
osg::StateSet::OVERRIDE_RENDERBIN_DETAILS);

osg::ref_ptr<osgText::Text> pText( new osgText::Text );
osg::ref_ptr<osg::Geode> pTextGeode ( new osg::Geode );
pText->setFont(pFont);
pText->setText(Text.c_str());
pText->setAutoRotateToScreen(true);
pText->setDrawMode(osgText::Text::TEXT |
osgText::Text::FILLEDBOUNDINGBOX);
pText->setBoundingBoxMargin(FontSize * 0.1);
pText->setFontResolution(96, 96);
pText->setCharacterSize(FontSize);
pText->setPosition(Position);
pText->setColor(osg::Vec4d(1,0,0,1));
pText->setStateSet(pStateset.get());
pText->setUseDisplayList(false);

pTextGeode->addDrawable(pText);
pTextGeode->setStateSet(pStateset);
return pTextGeode;


I'd be greatful for any help on the matter.
-Tim-









------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10989

PostPosted: Mon Apr 24, 2017 7:28 am    Post subject:
Vanishing letters in osg::Text
Reply with quote

HI Tim,

On 22 April 2017 at 22:51, Tim Hartter <> wrote:
Quote:
I have been playing around with different settings. Changing the bounding
box did not solve the problem.

The line I was thinking of that could be a problem was:

pText->setDrawMode(osgText::Text::TEXT | osgText::Text::FILLEDBOUNDINGBOX);

If commenting this out helps then it would suggest a depth issue.


Quote:
Strangely setting a style with depth 0.1 solves the problem if I connect via
Remote Desktop. Not assigning any font solves tge problem completely - the
text is just not pretty anymore.

The osgText::Style only affects the Text3D implementation, the
osgText::Text implementation ignores it.

So.... I can only guess you must mean something different by "style
with a depth 0.1", but if so then it's not to do with the OSG, so
really can't guess what you are actually meaning here.

Quote:
Can you tell me if you are using any special fallback settings in case no
font is assigned to osg::text?

? You are the one see a problem.

I'm not aware of any particular issues like you describe when testing
the OSG with examples like osgtext and on screen stats that uses text.

Could you create a small example, such as a by modifying an existing
OSG example like osgtext to reproduce the issue so that others can
test it to see that others can reproduce the issue.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Tim Hartter
Guest





PostPosted: Mon Apr 24, 2017 10:46 am    Post subject:
Vanishing letters in osg::Text
Reply with quote

Hi, I commented that line, but it did not make a difference.
What strikes me as odd is that only some letters disappear in the same text
node (string)

Tim

Mit AquaMail Android
http://www.aqua-mail.com gesendet


Am 24. April 2017 9:25:02 vorm. schrieb Robert Osfield
<>:

Quote:
HI Tim,

On 22 April 2017 at 22:51, Tim Hartter <> wrote:
Quote:
I have been playing around with different settings. Changing the bounding
box did not solve the problem.

The line I was thinking of that could be a problem was:

pText->setDrawMode(osgText::Text::TEXT | osgText::Text::FILLEDBOUNDINGBOX);

If commenting this out helps then it would suggest a depth issue.


Quote:
Strangely setting a style with depth 0.1 solves the problem if I connect via
Remote Desktop. Not assigning any font solves tge problem completely - the
text is just not pretty anymore.

The osgText::Style only affects the Text3D implementation, the
osgText::Text implementation ignores it.

So.... I can only guess you must mean something different by "style
with a depth 0.1", but if so then it's not to do with the OSG, so
really can't guess what you are actually meaning here.

Quote:
Can you tell me if you are using any special fallback settings in case no
font is assigned to osg::text?

? You are the one see a problem.

I'm not aware of any particular issues like you describe when testing
the OSG with examples like osgtext and on screen stats that uses text.

Could you create a small example, such as a by modifying an existing
OSG example like osgtext to reproduce the issue so that others can
test it to see that others can reproduce the issue.

Robert.





------------------
Post generated by Mail2Forum
Back to top
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10989

PostPosted: Mon Apr 24, 2017 1:23 pm    Post subject:
Vanishing letters in osg::Text
Reply with quote

On 24 April 2017 at 11:42, Tim Hartter <> wrote:
Quote:
Hi, I commented that line, but it did not make a difference.
What strikes me as odd is that only some letters disappear in the same text
node (string)

It's odd for sure. Unfortunately it's the type of problem that really
hard to know what might be wrong without seeing it first hand.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
wroos
Newbie


Joined: 25 Feb 2010
Posts: 7

PostPosted: Tue Apr 25, 2017 5:34 am    Post subject:
Re: Vanishing letters in osg::Text
Reply with quote

I've experienced a similar issue lately where we were running a project on lower spec systems with only an integrated GPU. On those systems the frame rate would not show properly, having the same issue as described here, with some numbers not showing properly.
I did a test on my laptop, and when I force it to use the integrated GPU (4600) the problems shows up as well. If I switch to use the GTX970M everything is fine again. This is all on Windows 10, osg 3.4.0
I haven't done any further investigation as the project is not using any Text objects, but maybe this might help somehow.
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10989

PostPosted: Tue Apr 25, 2017 8:21 am    Post subject:
Vanishing letters in osg::Text
Reply with quote

On 25 April 2017 at 06:34, Wouter Roos <> wrote:
Quote:
I've experienced a similar issue lately where we were running a project on lower spec systems with only an integrated GPU. On those systems the frame rate would not show properly, having the same issue as described here, with some numbers not showing properly.
I did a test on my laptop, and when I force it to use the integrated GPU (4600) the problems shows up as well. If I switch to use the GTX970M everything is fine again. This is all on Windows 10, osg 3.4.0
I haven't done any further investigation as the project is not using any Text objects, but maybe this might help somehow.

Some hardware/drivers don't support texture sub-loading correctly so
the osgText subloading of new glyphs could cause problems, perhaps
this is what you are seeing. It's problem that originally occurred on
Radeon's and some SGI hardware so there is a workaround in osgText
that detects these combinations in drivers, you can also enable the
workaround by setting the env var OSG_TEXT_INCREMENTAL_SUBLOADING to
OFF i.e. under bash you'd do:

export OSG_TEXT_INCREMENTAL_SUBLOADING=OFF
osgtext

Under windows I think it's something like:

set OSG_TEXT_INCREMENTAL_SUBLOADING=OFF
osgtext

The OSG master version has a had a major rewrite of osgText so it no
longer uses the texture subloading as may well just work out of the
box on the Intel GPU/drivers that you have.

Robert.


------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
emminizer
Newbie


Joined: 18 Aug 2015
Posts: 4

PostPosted: Tue Apr 25, 2017 10:18 am    Post subject:
Reply with quote

Hi,

We used to see this problem a lot. The OSG_TEXT_INCREMENTAL_SUBLOADING advice did not help. What did help was explicitly setting the GL_TEXTURE_MIN_FILTER at a slightly different place in osgText/Glyph.cpp.

Around line 373 you'll see a call to glPixelStorei() before the glTexSubImage2D() near the bottom of GlyphTexture::apply(). I add the following:
Code:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, getFilter(osg::Texture::MIN_FILTER));


Then around line 517 you'll see another call to glPixelStorei() before glTexSubImage2D() in Glyph::subload(). I add:

Code:

if (_texture)
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _texture->getFilter(osg::Texture::MIN_FILTER));
else
    glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);


This worked on the Intel cards. I expect it's some sort of driver bug, but I'm not sure.

I hope this helps.

- Dan
Back to top
View user's profile Send private message
robertosfield
OSG Project Lead


Joined: 18 Mar 2009
Posts: 10989

PostPosted: Tue Apr 25, 2017 10:40 am    Post subject:
Vanishing letters in osg::Text
Reply with quote

Hi Dan,

Could you post the whole modified file+unified path or PR or your
changes so they can be reviewed w.r.t original code. If there are
changes that might help others then I could check in a patch to the
relevant OSG master/3.2 and 3.4 branches.

Thanks,
Robert.

On 25 April 2017 at 11:18, Daniel Emminizer <> wrote:
Quote:
Hi,

We used to see this problem a lot. The OSG_TEXT_INCREMENTAL_SUBLOADING advice did not help. What did help was explicitly setting the GL_TEXTURE_MIN_FILTER at a slightly different place in osgText/Glyph.cpp.

Around line 373 you'll see a call to glPixelStorei() before the glTexSubImage2D() near the bottom of GlyphTexture::apply(). I add the following:

Code:

glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, getFilter(osg::Texture::MIN_FILTER));




Then around line 517 you'll see another call to glPixelStorei() before glTexSubImage2D() in Glyph::subload(). I add:


Code:

if (_texture)
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _texture->getFilter(osg::Texture::MIN_FILTER));
else
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, GL_LINEAR_MIPMAP_LINEAR);




This worked on the Intel cards. I expect it's some sort of driver bug, but I'm not sure.

I hope this helps.

- Dan

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=70829#70829








------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
emminizer
Newbie


Joined: 18 Aug 2015
Posts: 4

PostPosted: Tue Apr 25, 2017 11:29 am    Post subject:
Reply with quote

Hi Robert, sure thing. I created PR https://github.com/openscenegraph/OpenSceneGraph/pull/251 based on OpenSceneGraph-3.4 branch (where I made and tested locally last year). Thank you.
Back to top
View user's profile Send private message
Tim Hartter
Guest





PostPosted: Tue Apr 25, 2017 11:33 am    Post subject:
Vanishing letters in osg::Text
Reply with quote

Setting OSG_TEXT_INCREMENTAL_SUBLOADING to off does not make a difference
and YES it happens on Intel cards (not on Nvidia) (Win 7 OSG 3.4)

Maybe the patched OSG text works better...

Mit AquaMail Android
http://www.aqua-mail.com gesendet


Am 25. April 2017 10:18:21 vorm. schrieb Robert Osfield
<>:

Quote:
On 25 April 2017 at 06:34, Wouter Roos <> wrote:
Quote:
I've experienced a similar issue lately where we were running a project on
lower spec systems with only an integrated GPU. On those systems the frame
rate would not show properly, having the same issue as described here, with
some numbers not showing properly.
I did a test on my laptop, and when I force it to use the integrated GPU
(4600) the problems shows up as well. If I switch to use the GTX970M
everything is fine again. This is all on Windows 10, osg 3.4.0
I haven't done any further investigation as the project is not using any
Text objects, but maybe this might help somehow.

Some hardware/drivers don't support texture sub-loading correctly so
the osgText subloading of new glyphs could cause problems, perhaps
this is what you are seeing. It's problem that originally occurred on
Radeon's and some SGI hardware so there is a workaround in osgText
that detects these combinations in drivers, you can also enable the
workaround by setting the env var OSG_TEXT_INCREMENTAL_SUBLOADING to
OFF i.e. under bash you'd do:

export OSG_TEXT_INCREMENTAL_SUBLOADING=OFF
osgtext

Under windows I think it's something like:

set OSG_TEXT_INCREMENTAL_SUBLOADING=OFF
osgtext

The OSG master version has a had a major rewrite of osgText so it no
longer uses the texture subloading as may well just work out of the
box on the Intel GPU/drivers that you have.

Robert.





------------------
Post generated by Mail2Forum
Back to top
guyv
User


Joined: 13 Feb 2009
Posts: 84

PostPosted: Tue Apr 25, 2017 12:17 pm    Post subject:
Vanishing letters in osg::Text
Reply with quote

Hi,

I'm using OSG v3.4.0 and I resolved this issue by adding a glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,...) before calling glTexSubImage2D() in glyph.cpp. This problem was occurring if I was using an Intel video driver.

void Glyph::subload() const
{
[...]

// MTSI_BEGIN
// This line was added to resolve a problem with intel chipsets. In essence, some of the
// numeric glyphs would not display correctly. They would appear grey or transparent.
if( getTexture() )
{
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, getTexture()->getFilter( osg::Texture::MIN_FILTER ) );
}
// MTSI_END

glTexSubImage2D(GL_TEXTURE_2D,0,
_texturePosX,_texturePosY,
s(),t(),
(GLenum)getPixelFormat(),
(GLenum)getDataType(),
data());
[...]
}

void GlyphTexture::apply(osg::State& state) const
{
[...]
// MTSI_BEGIN
// This line was added to resolve a problem with intel chipsets. In essence, some of the
// numeric glyphs would not display correctly. They would appear grey or transparent.
glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _min_filter);
// MTSI_END
// Subload the image once
glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0,
getTextureWidth(),
getTextureHeight(),
OSGTEXT_GLYPH_FORMAT, GL_UNSIGNED_BYTE, local_data);
[...]
}

Regards,

-----Original Message-----
From: osg-users [mailto:] On Behalf Of Tim Hartter
Sent: April-25-17 7:29 AM
To: OpenSceneGraph Users
Subject: Re: Vanishing letters in osg::Text

Setting OSG_TEXT_INCREMENTAL_SUBLOADING to off does not make a difference and YES it happens on Intel cards (not on Nvidia) (Win 7 OSG 3.4)

Maybe the patched OSG text works better...

Mit AquaMail Android
http://www.aqua-mail.com gesendet


Am 25. April 2017 10:18:21 vorm. schrieb Robert Osfield
<>:

Quote:
On 25 April 2017 at 06:34, Wouter Roos <> wrote:
Quote:
I've experienced a similar issue lately where we were running a
project on lower spec systems with only an integrated GPU. On those
systems the frame rate would not show properly, having the same issue
as described here, with some numbers not showing properly.
I did a test on my laptop, and when I force it to use the integrated
GPU
(4600) the problems shows up as well. If I switch to use the GTX970M
everything is fine again. This is all on Windows 10, osg 3.4.0 I
haven't done any further investigation as the project is not using
any Text objects, but maybe this might help somehow.

Some hardware/drivers don't support texture sub-loading correctly so
the osgText subloading of new glyphs could cause problems, perhaps
this is what you are seeing. It's problem that originally occurred on
Radeon's and some SGI hardware so there is a workaround in osgText
that detects these combinations in drivers, you can also enable the
workaround by setting the env var OSG_TEXT_INCREMENTAL_SUBLOADING to
OFF i.e. under bash you'd do:

export OSG_TEXT_INCREMENTAL_SUBLOADING=OFF
osgtext

Under windows I think it's something like:

set OSG_TEXT_INCREMENTAL_SUBLOADING=OFF
osgtext

The OSG master version has a had a major rewrite of osgText so it no
longer uses the texture subloading as may well just work out of the
box on the Intel GPU/drivers that you have.

Robert.

org




________________________________


This e-mail may contain proprietary information and/or copyright material. This e-mail is intended for the use of the addressee only. Any unauthorized use may be unlawful. If you receive this e-mail by mistake, please advise the sender immediately by using the reply facility in your e-mail software.

Information contained in and/or attached to this document may be subject to export control regulations of the European Community, USA, or other countries. Each recipient of this document is responsible to ensure that usage and/or transfer of any information contained in this document complies with all relevant export control regulations. If you are in any doubt about the export control restrictions that apply to this information, please contact the sender immediately.

Be aware that Meggitt may monitor incoming and outgoing e-mails to ensure compliance with the Meggitt IT Use policy.



------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Maxim Gammer (Maxim Gammer)
Appreciator


Joined: 14 May 2009
Posts: 128

PostPosted: Mon May 15, 2017 12:31 pm    Post subject:
Vanishing letters in osg::Text
Reply with quote

Here is the solution:

text->setFontResolution(18,1Cool;





2017-04-25 17:13 GMT+05:00 Volckaert, Guy (CA - MTS) < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:
Quote:
Hi,

I'm using OSG v3.4.0 and I resolved this issue by adding a glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER,...) before calling glTexSubImage2D() in glyph.cpp. This problem was occurring if I was using an Intel video driver.

void Glyph::subload() const
{
[...]

// MTSI_BEGIN
    // This line was added to resolve a problem with intel chipsets. In essence, some of the
    // numeric glyphs would not display correctly. They would appear grey or transparent.
    if( getTexture() )
    {
        glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, getTexture()->getFilter( osg::Texture::MIN_FILTER ) );
    }
// MTSI_END

    glTexSubImage2D(GL_TEXTURE_2D,0,
                    _texturePosX,_texturePosY,
                    s(),t(),
                    (GLenum)getPixelFormat(),
                    (GLenum)getDataType(),
                    data());
[...]
}

void GlyphTexture::apply(osg::State& state) const
{
[...]
// MTSI_BEGIN
            // This line was added to resolve a problem with intel chipsets. In essence, some of the
            // numeric glyphs would not display correctly. They would appear grey or transparent.
            glTexParameteri( GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, _min_filter);
// MTSI_END
            // Subload the image once
            glTexSubImage2D( GL_TEXTURE_2D, 0, 0, 0,
                    getTextureWidth(),
                    getTextureHeight(),
                    OSGTEXT_GLYPH_FORMAT, GL_UNSIGNED_BYTE, local_data);
[...]
}

Regards,

-----Original Message-----
From: osg-users [mailto: (
Only registered users can see emails on this board!
Get registred or enter the forums!
)] On Behalf Of Tim Hartter
Sent: April-25-17 7:29 AM
To: OpenSceneGraph Users
Subject: Re: Vanishing letters in osg::Text

Setting OSG_TEXT_INCREMENTAL_SUBLOADING to off does not make a difference and YES it happens on Intel cards (not on Nvidia) (Win 7 OSG 3.4)

Maybe the patched OSG text works better...

Mit AquaMail Android
http://www.aqua-mail.com gesendet


Am 25. April 2017 10:18:21 vorm. schrieb Robert Osfield
< (
Only registered users can see emails on this board!
Get registred or enter the forums!
)>:

Quote:
On 25 April 2017 at 06:34, Wouter Roos < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
I've experienced a similar issue lately where we were running a
project on lower spec systems with only an integrated GPU. On those
systems the frame rate would not show properly, having the same issue
as described here, with some numbers not showing properly.
I did a test on my laptop, and when I force it to use the integrated
GPU
(4600) the problems shows up as well. If I switch to use the GTX970M
everything is fine again. This is all on Windows 10, osg 3.4.0 I
haven't done any further investigation as the project is not using
any Text objects, but maybe this might help somehow.

Some hardware/drivers don't support texture sub-loading correctly so
the osgText subloading of new glyphs could cause problems, perhaps
this is what you are seeing.  It's problem that originally occurred on
Radeon's and some SGI hardware so there is a workaround in osgText
that detects these combinations in drivers, you can also enable the
workaround by setting the env var OSG_TEXT_INCREMENTAL_SUBLOADING to
OFF i.e. under bash you'd do:

   export OSG_TEXT_INCREMENTAL_SUBLOADING=OFF
   osgtext

Under windows I think it's something like:

   set OSG_TEXT_INCREMENTAL_SUBLOADING=OFF
   osgtext

The OSG master version has a had a major rewrite of osgText so it no
longer uses the texture subloading as may well just work out of the
box on the Intel GPU/drivers that you have.

Robert.
_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.
org


_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

________________________________




This e-mail may contain proprietary information and/or copyright material. This e-mail is intended for the use of the addressee only. Any unauthorized use may be unlawful. If you receive this e-mail by mistake, please advise the sender immediately by using the reply facility in your e-mail software.

Information contained in and/or attached to this document may be subject to export control regulations of the European Community, USA, or other countries. Each recipient of this document is responsible to ensure that usage and/or transfer of any information contained in this document complies with all relevant export control regulations. If you are in any doubt about the export control restrictions that apply to this information, please contact the sender immediately.

Be aware that Meggitt may monitor incoming and outgoing e-mails to ensure compliance with the Meggitt IT Use policy.

_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org






--
--------------------------------
Maxim Gammer

+79199510073

------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts A problem of depth on osgText::Text i... gyw General 4 Mon Jul 10, 2017 7:29 am View latest post
No new posts How to color each character of an osg... lq37 General 0 Thu Jun 22, 2017 1:31 pm View latest post
No new posts Missing Text tnassour General 0 Thu Apr 13, 2017 8:55 am View latest post
No new posts How to disable Antialiasing of an ... lq37 General 9 Thu Mar 02, 2017 5:41 pm View latest post
No new posts Text colors in shaders wernerM General 5 Fri Feb 24, 2017 12:00 pm View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP