[osg-users] bluring model edges

Guy guy at dvp.co.il
Mon Mar 23 00:08:18 PDT 2009


Julia,

I never tried it but you should enable GL_POLYGON_SMOOTH, and enable
alpha blending for the object you want to 'blur'.

For example:

    	osg::StateSet * stateset = geode->getOrCreateStateSet();
    	stateset->setMode(GL_POLYGON_SMOOTH, osg::StateAttribute::ON);


	osg::BlendFunc *fn = new osg::BlendFunc();
	fn->setFunction(osg::BlendFunc::SRC_ALPHA, 			
		osg::BlendFunc::ONE_MINUS_SRC_ALPHA);

	
	stateset->setAttributeAndModes(fn,
 		osg::StateAttribute::ON);
	stateset->setMode(GL_BLEND, osg::StateAttribute::ON);
	stateset->setRenderingHint(osg::StateSet::TRANSPARENT_BIN);

Good luck,
Guy.

Hi,

Is it possible to blur the edges of a model in OSG with whatever is
behind?
Currently the edges of the models in my scene are too sharp and would
look better if there was a translucent overlap at the edges.

Is this possible to achieve in OSG, or is this kind of functionality
more relevant to OpenGL?

Thank you,
Julia

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





_______________________________________________
osg-users mailing list
osg-users at lists.openscenegraph.org
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.or
g



More information about the osg-users mailing list