Re: [osg-users] Vanishing letters in osg::Text
Here is the solution: text->setFontResolution(18,18); 2017-04-25 17:13 GMT+05:00 Volckaert, Guy (CA - MTS) < guy.volcka...@meggitt.com>: > 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:osg-users-boun...@lists.openscenegraph.org] On > Behalf Of Tim Hartter > Sent: April-25-17 7:29 AM > To: OpenSceneGraph Users > Subject: Re: [osg-users] 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 > <robert.osfi...@gmail.com>: > > > On 25 April 2017 at 06:34, Wouter Roos <rooswou...@gmail.com> wrote: > >> 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 > > osg-users@lists.openscenegraph.org > > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph. > > org > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > 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 th
Re: [osg-users] Vanishing letters in osg::Text
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:osg-users-boun...@lists.openscenegraph.org] On Behalf Of Tim Hartter Sent: April-25-17 7:29 AM To: OpenSceneGraph Users Subject: Re: [osg-users] 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 <robert.osfi...@gmail.com>: > On 25 April 2017 at 06:34, Wouter Roos <rooswou...@gmail.com> wrote: >> 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 > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph. > org ___ osg-users mailing list osg-users@lists.openscenegraph.org 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-mai
Re: [osg-users] 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: On 25 April 2017 at 06:34, Wouter Roos wrote: 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 osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
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. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70832#70832 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
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 Emminizerwrote: > 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 > > > > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
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 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
On 25 April 2017 at 06:34, Wouter Rooswrote: > 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 osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
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. -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70827#70827 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
On 24 April 2017 at 11:42, Tim Hartterwrote: > 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. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
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: HI Tim, On 22 April 2017 at 22:51, Tim Hartter wrote: 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. 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. 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. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
HI Tim, On 22 April 2017 at 22:51, Tim Hartterwrote: > 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. > 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. > 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. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
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: 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: 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 pStateset(new osg::StateSet()); pStateset->setMode(GL_LIGHTING, osg::StateAttribute::OFF | osg::StateAttribute::PROTECTED | osg::StateAttribute::OVERRIDE); pStateset->setMode(GL_BLEND, osg::StateAttribute::ON); pStateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); pStateset->setRenderBinDetails(INT_MAX, "RenderBin", osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); osg::ref_ptr pText( new osgText::Text ); osg::ref_ptr 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- ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
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 Hartterwrote: > 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 pStateset(new osg::StateSet()); > > pStateset->setMode(GL_LIGHTING, > osg::StateAttribute::OFF | > osg::StateAttribute::PROTECTED | > osg::StateAttribute::OVERRIDE); > > pStateset->setMode(GL_BLEND, osg::StateAttribute::ON); > pStateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); > pStateset->setRenderBinDetails(INT_MAX, "RenderBin", > osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); > > osg::ref_ptr pText( new osgText::Text ); > osg::ref_ptr 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- > > > ___ > osg-users mailing list > osg-users@lists.openscenegraph.org > http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org > ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] Vanishing letters in osg::Text
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...) > > > osg::ref_ptr�pStateset(new�osg::StateSet()); > > > > pStateset->setMode(GL_LIGHTING, > > osg::StateAttribute::OFF�| > > osg::StateAttribute::PROTECTED�| > > osg::StateAttribute::OVERRIDE); > > > > pStateset->setMode(GL_BLEND,�osg::StateAttribute::ON); > > pStateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN); > > > > pStateset->setRenderBinDetails(INT_MAX,�"RenderBin",�osg::StateSet::OVERRIDE_RENDERBIN_DETAILS); > > > > osg::ref_ptr�pText(�new�osgText::Text�); > > osg::ref_ptr�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 -- Read this topic online here: http://forum.openscenegraph.org/viewtopic.php?p=70810#70810 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org