In collada: implemented all missing transparency features from standard (ie RGB_ZERO, RGB_ONE and A_ZERO)

+ removed user option to invert transparency as it does not seem to be needed anymore
+ fixed bug in default reflectivity value
This commit is contained in:
Léo Terziman
2015-12-08 15:24:07 +01:00
parent d1e21045dc
commit 445ae1fec3
5 changed files with 25 additions and 23 deletions

View File

@@ -1240,12 +1240,17 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
else if( IsElement( "transparent")) {
pEffect.mHasTransparency = true;
// In RGB_ZERO mode, the transparency is interpreted in reverse, go figure...
if(::strcmp(mReader->getAttributeValueSafe("opaque"), "RGB_ZERO") == 0) {
// TODO: handle RGB_ZERO mode completely
const char* opaque = mReader->getAttributeValueSafe("opaque");
if(::strcmp(opaque, "RGB_ZERO") == 0 || ::strcmp(opaque, "RGB_ONE") == 0) {
pEffect.mRGBTransparency = true;
}
// In RGB_ZERO mode, the transparency is interpreted in reverse, go figure...
if(::strcmp(opaque, "RGB_ZERO") == 0 || ::strcmp(opaque, "A_ZERO") == 0) {
pEffect.mInvertTransparency = true;
}
ReadEffectColor( pEffect.mTransparent,pEffect.mTexTransparent);
}
else if( IsElement( "shininess"))