Jason Daly wrote:
Roger James wrote:The problem I have is deciding if the surface is going to end up fully opaque when there is a texture in the diffuse channel supplying the incoming fragments alpha component. The best I can come up with is this, but it is messy and does not take it account any modification of the incoming frgaments alpha component by the application of the lighting equation. if (transparent or transparency element present in the technique) { Calculate a blending factor using transparent and transparency according to the "opaque" mode in force. // Decide whether to use GL_SRC_XXX or GL_CONSTANT _XXX in the OpenGL blender if (the calculated factor would mean opacity when applied) { if (there is a translucent texture in the diffuse channel) { Use the relevant blend factor from the incoming lit and textured fragment Turn on the OpenGL blender } else if (the calculated factor along with the alpha from the constant diffuse colour woud result in a translucent colour) { Use the relevant blend factor from the incoming lit and textured fragment Turn on the OpenGL blender } } else { Use the previously calculated blending factor as a constant blend factor Turn on the OpenGL blender } } I cannot believe that a profile that is meant to represent fixed functionality ends up this messy. It just highlights the _opacity_ of the spec in this area :-) Roger |
_______________________________________________ osg-users mailing list [email protected] http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org

