[Bf-blender-cvs] [71323f0] master: Intensity and color are now adjusted upon import to get correct values
gaiaclary
noreply at git.blender.org
Sat Aug 9 20:50:59 CEST 2014
Commit: 71323f042565dd73ed5a45a5d00e984fa0a164b8
Author: gaiaclary
Date: Sat Aug 9 20:50:35 2014 +0200
Branches: master
https://developer.blender.org/rB71323f042565dd73ed5a45a5d00e984fa0a164b8
Intensity and color are now adjusted upon import to get correct values
===================================================================
M source/blender/collada/DocumentImporter.cpp
===================================================================
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp
index bbbbbf2..97d300e 100644
--- a/source/blender/collada/DocumentImporter.cpp
+++ b/source/blender/collada/DocumentImporter.cpp
@@ -805,10 +805,14 @@ void DocumentImporter::write_profile_COMMON(COLLADAFW::EffectCommon *ef, Materia
// DIFFUSE
// color
if (ef->getDiffuse().isColor()) {
+ /* too high intensity can create artefacts (fireflies)
+ So here we take care that intensity is set to 0.8 wherever possible
+ */
col = ef->getDiffuse().getColor();
- ma->r = col.getRed();
- ma->g = col.getGreen();
- ma->b = col.getBlue();
+ ma->ref = max_ffff(col.getRed(), col.getGreen(), col.getBlue(), 0.8);
+ ma->r = col.getRed() / ma->ref;
+ ma->g = col.getGreen() / ma->ref;
+ ma->b = col.getBlue() / ma->ref;
}
// texture
else if (ef->getDiffuse().isTexture()) {
More information about the Bf-blender-cvs
mailing list