Hi Phil,
Dirk Reiners wrote:
> It might. By default OpenSG assumes that image formats that have alpha
> also use it (which is not always the case). I tentatively fixed that in
> the 3DS loader, but we might want to make it more general.
>
> The quick fix is what you say: convert the non-transparent textures into
> a format that doesn't have alpha.
>
I just realized that you obviously have your own loader (duh!), so you
might want to add the following bits and pieces to it:
after loading a texture, please call
beginEditCP(image, Image::ForceAlphaBinaryFieldMask);
image->setForceAlphaBinary(image->calcIsAlphaBinary());
endEditCP(image, Image::ForceAlphaBinaryFieldMask);
If you use SimpleTexturedMaterials they should automatically add the
correct BlendChunk, if you do your own you should do something like this:
if(getImage() != NullFC &&
getImage()->hasAlphaChannel() &&
getEnvMode() != GL_DECAL)
{
if(getImage()->isAlphaBinary())
{
beginEditCP(_blendChunk);
_blendChunk->setSrcFactor(GL_ONE);
_blendChunk->setDestFactor(GL_ZERO);
_blendChunk->setAlphaFunc(GL_NOTEQUAL);
_blendChunk->setAlphaValue(0);
endEditCP(_blendChunk);
}
else
{
beginEditCP(_blendChunk);
_blendChunk->setSrcFactor(GL_SRC_ALPHA);
_blendChunk->setDestFactor(GL_ONE_MINUS_SRC_ALPHA);
_blendChunk->setAlphaFunc(GL_NONE);
_blendChunk->setAlphaValue(0);
endEditCP(_blendChunk);
}
}
Hope it helps
Dirk
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Opensg-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/opensg-users