Re: [osg-users] osgText quality issue
Hi Farshid, An interesting result. I'm afraid I can't recall the reason for the change, it will have been done quite a while ago. subversion's revisions might be able to unearth why sizeAdjustment is now 1- but it's pretty likely it was an attempt to improve one aspect of rendering so if we change it there is good chance that we'll improve on one area but make another area worse. If we can find out what cases require sizeAdjustment of 1 then perhaps we'll be able to build a test that reproduces both the issue you are seeing and this other one then we can come up with an all round solution. Robert. On Wed, Mar 17, 2010 at 8:29 PM, Farshid Lashkari fla...@gmail.com wrote: Hi, I'm in the process of porting our application from OSG 1.2 to 2.9. One major issue that immediately stood out was the quality of osgText. All the letters seem to be cut off by one pixel along the edges. There has been a lot of changes since 1.2, but I did find one setting that seemed to fix the issue for me. On line 539 of Font.cpp there is a hard-coded variable called sizeAdjustment that is set to 1. In OSG 1.2 this value was set to 0. Changing this value back to 0 pretty much resolves the quality issue for me. I've attached a screenshot comparing the result of changing the value. Does anybody else notice these artifacts? Is there a downside to changing the sizeAdjustment value back to 0? Any insight is appreciated. Cheers, Farshid ___ 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] osgText quality issue
Hi, On Wednesday 17 March 2010, Farshid Lashkari wrote: I'm in the process of porting our application from OSG 1.2 to 2.9. One major issue that immediately stood out was the quality of osgText. All the letters seem to be cut off by one pixel along the edges. There has been a lot of changes since 1.2, but I did find one setting that seemed to fix the issue for me. On line 539 of Font.cpp there is a hard-coded variable called sizeAdjustment that is set to 1. In OSG 1.2 this value was set to 0. Changing this value back to 0 pretty much resolves the quality issue for me. I've attached a screenshot comparing the result of changing the value. Does anybody else notice these artifacts? Is there a downside to changing the sizeAdjustment value back to 0? Any insight is appreciated. Yes, I was coding around that in the QFont implementation by an own margin that appeared to fix that problem. That left the original reason on the todo list ... Glad to see that we know where this happens. Greetings Mathias -- Dr. Mathias Fröhlich, science + computing ag, Software Solutions Hagellocher Weg 71-75, D-72070 Tuebingen, Germany Phone: +49 7071 9457-268, Fax: +49 7071 9457-511 -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Michel Lepert Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgText quality issue
Hi Im not sure if this is the last time it was changed, but inspecting the log it was changed a revision 6602 from unsigned int sizeAdjustment = 0; // was 1. to unsigned int sizeAdjustment = 1; With the following comment: *Reorganised the managment of margins around glyphs so that is done entirely with src/osgText/Font.cpp rather than the font plugins or Text.cpp* ** Not really sure why, but I couldent help looking for it so I might as well share. Brgs. Ralf Stokholm 2010/3/18 Mathias Fröhlich m.froehl...@science-computing.de Hi, On Wednesday 17 March 2010, Farshid Lashkari wrote: I'm in the process of porting our application from OSG 1.2 to 2.9. One major issue that immediately stood out was the quality of osgText. All the letters seem to be cut off by one pixel along the edges. There has been a lot of changes since 1.2, but I did find one setting that seemed to fix the issue for me. On line 539 of Font.cpp there is a hard-coded variable called sizeAdjustment that is set to 1. In OSG 1.2 this value was set to 0. Changing this value back to 0 pretty much resolves the quality issue for me. I've attached a screenshot comparing the result of changing the value. Does anybody else notice these artifacts? Is there a downside to changing the sizeAdjustment value back to 0? Any insight is appreciated. Yes, I was coding around that in the QFont implementation by an own margin that appeared to fix that problem. That left the original reason on the todo list ... Glad to see that we know where this happens. Greetings Mathias -- Dr. Mathias Fröhlich, science + computing ag, Software Solutions Hagellocher Weg 71-75, D-72070 Tuebingen, Germany Phone: +49 7071 9457-268, Fax: +49 7071 9457-511 -- Vorstand/Board of Management: Dr. Bernd Finkbeiner, Dr. Roland Niemeier, Dr. Arno Steitz, Dr. Ingrid Zech Vorsitzender des Aufsichtsrats/ Chairman of the Supervisory Board: Michel Lepert Sitz/Registered Office: Tuebingen Registergericht/Registration Court: Stuttgart Registernummer/Commercial Register No.: HRB 382196 ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org -- Ralf Stokholm Director RD Email: a...@arenalogic.com Phone: +45 28 30 83 52 Web: www.arenalogic.com This transmission and any accompanying documents are intended only for confidential use of the designated recipient(s) identified above. This message contains proprietary information belonging to Arenalogic Aps. If you have received this message by error, please notify the sender. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgText quality issue
Hi Ralf, On Thu, Mar 18, 2010 at 9:22 AM, Ralf Stokholm alfma...@arenalogic.com wrote: Im not sure if this is the last time it was changed, but inspecting the log it was changed a revision 6602 from Thanks for the detective work. From Tracs the changes are: http://www.openscenegraph.org/projects/osg/changeset/6602/OpenSceneGraph/trunk/src/osgText/Font.cpp http://www.openscenegraph.org/projects/osg/changeset/6602/OpenSceneGraph/trunk/src/osgText/Text.cpp From what I can make out the texture coordinate set up is the part that is critical, and the new code is effectively using xpos/(textureWidth-1) to compute a texture coordinate, while for Farshid and others are reporting that use of xpos/(textureWidth-0) is producing better results. However there is more going on with margins and the actual quad geometry that Text.cpp uses, as well as the potential for the clamp mode on the texture to effect things as well, so right now I'm not ready to make any decision about what the correct code should be, but it's likely to involve more than just changing a 0 to 1. I suspect a wider review of the maths of placement of the glyphs in the texture, the maths used by the GPU to map the tex coordinates to the texels, and the sizes of the quads used by Text.cpp. Note the quad geometry will be oversized slightly to make sure that mipmapping does loose the border of the glyph. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgText quality issue
Hi All, I've been reviewing the texcoord maths in Font.cpp and Text.cpp and believe that the sizeAdjustment should actually be 0.0, and the we need to also add CLAMP_TO_EDGE. I have been testing using the osgfont example and this change results in better looking text, inline with Farshid's result. osgfont fonts/arial.ttf 10 15 20 25 30 40 80 An svn update will get these changes. Robert. ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgText quality issue
Hi Robert, I just tried the latest changes and the text looks good. Thanks! Cheers, Farshid On Thu, Mar 18, 2010 at 7:42 AM, Robert Osfield robert.osfi...@gmail.comwrote: Hi All, I've been reviewing the texcoord maths in Font.cpp and Text.cpp and believe that the sizeAdjustment should actually be 0.0, and the we need to also add CLAMP_TO_EDGE. I have been testing using the osgfont example and this change results in better looking text, inline with Farshid's result. osgfont fonts/arial.ttf 10 15 20 25 30 40 80 An svn update will get these changes. 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] osgText quality issue
Hello Farshid, Does anybody else notice these artifacts? Is there a downside to changing the sizeAdjustment value back to 0? Any insight is appreciated. Yes, it has been discussed in the past on the list, check the archives. It was even stated by Jeremy Moles as the major reason why he developed the osgPango nodekit :-) I can't answer your other question, I'll have to defer to others who know osgText better. But it's good that a real solution to this problem (other than switching to an external nodekit to do text rendering) is in sight. Good work. J-S -- __ Jean-Sebastien Guayjean-sebastien.g...@cm-labs.com http://www.cm-labs.com/ http://whitestar02.webhop.org/ ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org
Re: [osg-users] osgText quality issue
This is a good suggestion. I've been using osgText a lot lately, and this change definitely improves the quality in my apps. -- Terry Welsh / mogumbo 'at' gmail.com www.reallyslick.com / www.mogumbo.com Message: 3 Date: Wed, 17 Mar 2010 13:29:43 -0700 From: Farshid Lashkari fla...@gmail.com To: OpenSceneGraph Users osg-users@lists.openscenegraph.org Subject: [osg-users] osgText quality issue Message-ID: 978d1eac1003171329l4f526d49q78495dbc1f958...@mail.gmail.com Content-Type: text/plain; charset=iso-8859-1 Hi, I'm in the process of porting our application from OSG 1.2 to 2.9. One major issue that immediately stood out was the quality of osgText. All the letters seem to be cut off by one pixel along the edges. There has been a lot of changes since 1.2, but I did find one setting that seemed to fix the issue for me. On line 539 of Font.cpp there is a hard-coded variable called sizeAdjustment that is set to 1. In OSG 1.2 this value was set to 0. Changing this value back to 0 pretty much resolves the quality issue for me. I've attached a screenshot comparing the result of changing the value. Does anybody else notice these artifacts? Is there a downside to changing the sizeAdjustment value back to 0? Any insight is appreciated. Cheers, Farshid -- next part -- An HTML attachment was scrubbed... URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20100317/d0591de3/attachment-0001.htm -- next part -- A non-text attachment was scrubbed... Name: osgTextSizeAdjustment.png Type: image/png Size: 55917 bytes Desc: not available URL: http://lists.openscenegraph.org/pipermail/osg-users-openscenegraph.org/attachments/20100317/d0591de3/attachment-0001.png ___ osg-users mailing list osg-users@lists.openscenegraph.org http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org