On Mon, 2006-10-16 at 11:09 +1000, Drew Whitehouse wrote:
> This is where I'm heading, but the RGB_ZERO case is just showing black 
> at the moment.

[munch]

> You posted
> 
> In RGB_ZERO opaque mode you compute per component transparency blending:
> 
> result.r = fb.r * (transparent.r * transparency) + mat.r *
>            (1.0f - transparent.r * transparency)
> result.g = fb.g * (transparent.g * transparency) + mat.g *
>            (1.0f - transparent.g * transparency)
> result.b = fb.b * (transparent.b * transparency) + mat.b *
>            (1.0f - transparent.b * transparency) 
> 
> Plugging in the mat values for the diffuse component we get:
> 
> result.rgb = [ 0.988235 0.909804 0.019608 ]
> 
> ... the material color replaces the framebuffer (fb) color opaquely.
> 
> 
> But result.a = 0.0. Is that meaningful.
> Are the fb colors pre-multiplied by alpha, opengl experts ?

That depends on your OpenGL blending mode. Since OpenGL fixed-function
can only approximate this type of transparency, I'm assuming glBlendFunc
(GL_ONE, GL_ONE_MINUS_SRC_ALPHA) is enabled. You should double check
that it works with the material you construct.

man glEnable(GL_BLEND) and glBlendFunc() to learn more.

Regards,
Marcus


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

Reply via email to