diff options
author | gaiaclary <gaia.clary@machinimatrix.org> | 2014-08-09 22:50:35 +0400 |
---|---|---|
committer | gaiaclary <gaia.clary@machinimatrix.org> | 2014-08-09 22:50:35 +0400 |
commit | 71323f042565dd73ed5a45a5d00e984fa0a164b8 (patch) | |
tree | f77e48efd039709bb1e6be55a10575e83fe7ef50 /source | |
parent | afce1057fdb3c51819b7126fd3593fe7a2c80b57 (diff) |
Intensity and color are now adjusted upon import to get correct values
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/collada/DocumentImporter.cpp | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/source/blender/collada/DocumentImporter.cpp b/source/blender/collada/DocumentImporter.cpp index bbbbbf211c6..97d300e77f5 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()) { |