fix T48857: Improved the handling of Material Alpha, based on patch D1949 with some small modifications

This commit is contained in:
2016-07-15 16:14:32 +02:00
committed by Gaia Clary
parent 27641b51e7
commit b679767656

View File

@@ -924,8 +924,12 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
// TRANSPARENT
// color
if (ef->getOpacity().isColor()) {
float alpha = ef->getOpacity().getColor().getAlpha();
if (alpha < 1) {
col = ef->getTransparent().getColor();
float alpha = ef->getTransparency().getFloatValue();
if (col.isValid()) {
alpha *= col.getAlpha(); // Assuming A_ONE opaque mode
}
if (col.isValid() || alpha < 1.0) {
ma->alpha = alpha;
ma->mode |= MA_ZTRANSP | MA_TRANSP;
}