Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGaia Clary <gaia.clary@machinimatrix.org>2016-07-14 22:42:44 +0300
committerGaia Clary <gaia.clary@machinimatrix.org>2016-07-14 22:43:26 +0300
commit558f85473eb894588dde1240b2eca9d7d0ed1647 (patch)
treecf60cdafce6f3bf7929e2fcee0753609cebd25a0 /source/blender/collada
parent902d4c92ac3d0146984c459ba95f75f72324f675 (diff)
fix T48857: Added support for transparency (used Patch D1949 from bwrsandman with some slight changes)
Diffstat (limited to 'source/blender/collada')
-rw-r--r--source/blender/collada/DocumentImporter.cpp32
1 files changed, 14 insertions, 18 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index f06f299d381..b91039fe012 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -904,6 +904,7 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
i++;
}
}
+
// EMISSION
// color
if (ef->getEmission().isColor()) {
@@ -919,8 +920,18 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
i++;
}
}
-
- if (ef->getOpacity().isTexture()) {
+
+ // TRANSPARENT
+ // color
+ if (ef->getOpacity().isColor()) {
+ float alpha = ef->getOpacity().getColor().getAlpha();
+ if (alpha < 1) {
+ ma->alpha = alpha;
+ ma->mode |= MA_ZTRANSP | MA_TRANSP;
+ }
+ }
+ // texture
+ else if (ef->getOpacity().isTexture()) {
COLLADAFW::Texture ctex = ef->getOpacity().getTexture();
mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
if (mtex != NULL) {
@@ -930,22 +941,7 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
ma->mode |= MA_ZTRANSP | MA_TRANSP;
}
}
- // TRANSPARENT
- // color
-#if 0
- if (ef->getOpacity().isColor()) {
- // XXX don't know what to do here
- }
- // texture
- else if (ef->getOpacity().isTexture()) {
- ctex = ef->getOpacity().getTexture();
- if (mtex != NULL) mtex->mapto &= MAP_ALPHA;
- else {
- mtex = create_texture(ef, ctex, ma, i, texindex_texarray_map);
- if (mtex != NULL) mtex->mapto = MAP_ALPHA;
- }
- }
-#endif
+
material_texture_mapping_map[ma] = texindex_texarray_map;
}