Improved handling of transparency in collada importer

+ started preliminary support for RGB_ZERO collada transparency mode
+ added option to manually invert transparency values to deal with broken exporters that don't follow the specs
This commit is contained in:
Léo Terziman
2015-02-18 17:20:03 +01:00
parent b367d9b390
commit d9a2293491
5 changed files with 36 additions and 6 deletions

View File

@@ -1199,6 +1199,14 @@ void ColladaParser::ReadEffectProfileCommon( Collada::Effect& pEffect)
ReadEffectColor( pEffect.mReflective, pEffect.mTexReflective);
}
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
pEffect.mRGBTransparency = true;
}
ReadEffectColor( pEffect.mTransparent,pEffect.mTexTransparent);
}
else if( IsElement( "shininess"))