[osg-users] antialiased lines

2008-04-24 Thread Gianluca Natale
Hi OSG developers!

 

I'm trying to draw antialiased lines with OSG ver .2.2, but I'm having
problems.

 

This is my code:

 

   osg::ref_ptrosg::Hint antialiasHint = new
osg::Hint(GL_LINE_SMOOTH_HINT, GL_NICEST);

   StateSet-setAttributeAndModes(antialiasHint.get(),
osg::StateAttribute::ON);

 

Obviously I've also set a blending function.

Is there something wrong in my code, or a well-known bug in OSG 2.2?

 

Note that in OSG ver. 1.2 I obtained the same effect just by calling:

 

   StateSet-setMode(GL_LINE_SMOOTH, osg::StateAttribute::ON);

 

This still does work in OSG ver 2.2, but I wanted to update my code to the
correct use of glHint

under OSG.

 

Thank you in advance.

Gianluca Natale

 

___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org


Re: [osg-users] antialiased lines

2008-04-24 Thread Robert Osfield
Hi Gianluca,

The OSG just passes state along to the OpenGL, the glHint support is
just another means to setting OpenGL state.  How the OpenGL driver
responds to the that State is down to the driver/hardware.  In the
case of line smoothing I believe that you still need to enable
GL_LINE_SMOOTH even when using the hints, the mode simply enables the
use of filtering that the hints specify.

Robert.

On Thu, Apr 24, 2008 at 11:20 AM, Gianluca Natale
[EMAIL PROTECTED] wrote:




 Hi OSG developers!



 I'm trying to draw antialiased lines with OSG ver .2.2, but I'm having
 problems.



 This is my code:



osg::ref_ptrosg::Hint antialiasHint = new
 osg::Hint(GL_LINE_SMOOTH_HINT, GL_NICEST);

StateSet-setAttributeAndModes(antialiasHint.get(),
 osg::StateAttribute::ON);



 Obviously I've also set a blending function.

 Is there something wrong in my code, or a well-known bug in OSG 2.2?



 Note that in OSG ver. 1.2 I obtained the same effect just by calling:



StateSet-setMode(GL_LINE_SMOOTH, osg::StateAttribute::ON);



 This still does work in OSG ver 2.2, but I wanted to update my code to the
 correct use of glHint

 under OSG.



 Thank you in advance.

 Gianluca Natale


 ___
  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] antialiased lines

2008-04-24 Thread Michele Bosi
Ciao Gialluca,
you absolutely need to enable GL_LINE_SMOOTH and GL_BLEND and to setup
a blending function like for example osg::BlendFunc(GL_SRC_ALPHA,
GL_ONE_MINUS_SRC_ALPHA). The same goes for GL_POINT_SMOOTH.

Michele

On Thu, Apr 24, 2008 at 12:20 PM, Gianluca Natale
[EMAIL PROTECTED] wrote:




 Hi OSG developers!



 I'm trying to draw antialiased lines with OSG ver .2.2, but I'm having 
 problems.



 This is my code:



osg::ref_ptrosg::Hint antialiasHint = new osg::Hint(GL_LINE_SMOOTH_HINT, 
 GL_NICEST);

StateSet-setAttributeAndModes(antialiasHint.get(), 
 osg::StateAttribute::ON);



 Obviously I've also set a blending function.

 Is there something wrong in my code, or a well-known bug in OSG 2.2?



 Note that in OSG ver. 1.2 I obtained the same effect just by calling:



StateSet-setMode(GL_LINE_SMOOTH, osg::StateAttribute::ON);



 This still does work in OSG ver 2.2, but I wanted to update my code to the 
 correct use of glHint

 under OSG.



 Thank you in advance.

 Gianluca Natale


 ___
 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] antialiased lines

2008-04-24 Thread Gianluca Natale
Thank you.
So, the filter specified via osg::Hint
can be set only from OSG ver. 2.0, isn't it?

Gianluca

-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Robert
Osfield
Sent: Thursday, April 24, 2008 12:35 PM
To: OpenSceneGraph Users
Subject: Re: [osg-users] antialiased lines

Hi Gianluca,

The OSG just passes state along to the OpenGL, the glHint support is
just another means to setting OpenGL state.  How the OpenGL driver
responds to the that State is down to the driver/hardware.  In the
case of line smoothing I believe that you still need to enable
GL_LINE_SMOOTH even when using the hints, the mode simply enables the
use of filtering that the hints specify.

Robert.

On Thu, Apr 24, 2008 at 11:20 AM, Gianluca Natale
[EMAIL PROTECTED] wrote:




 Hi OSG developers!



 I'm trying to draw antialiased lines with OSG ver .2.2, but I'm having
 problems.



 This is my code:



osg::ref_ptrosg::Hint antialiasHint = new
 osg::Hint(GL_LINE_SMOOTH_HINT, GL_NICEST);

StateSet-setAttributeAndModes(antialiasHint.get(),
 osg::StateAttribute::ON);



 Obviously I've also set a blending function.

 Is there something wrong in my code, or a well-known bug in OSG 2.2?



 Note that in OSG ver. 1.2 I obtained the same effect just by calling:



StateSet-setMode(GL_LINE_SMOOTH, osg::StateAttribute::ON);



 This still does work in OSG ver 2.2, but I wanted to update my code to the
 correct use of glHint

 under OSG.



 Thank you in advance.

 Gianluca Natale


 ___
  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


-- 
No virus found in this incoming message.
Checked by AVG. 
Version: 7.5.524 / Virus Database: 269.23.4/1394 - Release Date: 23/04/2008
19.16


___
osg-users mailing list
osg-users@lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org