Hi Jacob,

You spotted the fix that should already be in CVS, as I came across
this very same problem a couple of weeks back.

The reason for the alpha not being active is that osgvolume just
created the scene to drop in to the opaque bin and eroneously never
enabled the glAlphaFunc/osg::AlphaFunc. The only reason why this
originally work is that the OSG used to default to enable alphafunc
for both the opaque and transparent bins, but now only does it for the
transparent bin.

Robert.

On 11/28/06, Jacob Foshee <[EMAIL PROTECTED]> wrote:
To whom it may concern:

I think I found a solution to the alpha-blending problem.  I changed the
following 2 lines in createModel():
>     stateset->setMode(GL_BLEND,osg::StateAttribute::ON);
>     stateset->setAttribute(new
osg::AlphaFunc(osg::AlphaFunc::GREATER,alphaFuncValue));
>

to:
> stateset->setAttributeAndModes(new osg::BlendFunc,
osg::StateAttribute::ON );
> osg::AlphaFunc* alphaFunc = new osg::AlphaFunc;
>
alphaFunc->setFunction(osg::AlphaFunc::GEQUAL,alphaFuncValue);
> stateset->setAttributeAndModes( alphaFunc, osg::StateAttribute::ON );
>

Now alpha blending is behaving as expected.



On 11/27/06, Jacob Foshee < [EMAIL PROTECTED]> wrote:
> Howdy,
> I cannibalized the osgvolume example to do some volume rendering for
> my application.
>
> The only function I changed was the main() function (primarily because
> it is not my main function, and my data has already been loaded).  I
> only have one channel in my data, so I set desiredPixelFormat to
> GL_LUMINANCE.
>
> I ran into 2 problems:
>
> - alphaFuncValue seems to be ineffective.  No matter what I set the
> alpha cut-off value to, I get the same results in my rendering.
> Blending is working, but it seems to behave as if alphaFuncValue is
> 0.0.
>
> - The corners of the volume get clipped off at certain angles.  As a
> remedy, I pass a cube size of 1.5 to createCube() rather than 1.0.  Is
> there a better solution?
>
 > Thanks!  And Kudos to the author (I think it was Robert) for making it
> so easy to get up and running w/ volume rendering.
>
> Jacob
>

_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/


_______________________________________________
osg-users mailing list
[email protected]
http://openscenegraph.net/mailman/listinfo/osg-users
http://www.openscenegraph.org/

Reply via email to