diff options
author | Nathan Letwory <nathan@letworyinteractive.com> | 2011-06-13 19:07:36 +0400 |
---|---|---|
committer | Nathan Letwory <nathan@letworyinteractive.com> | 2011-06-13 19:07:36 +0400 |
commit | 0af94b45e4220b213df3d344c71abc47abdd4612 (patch) | |
tree | c7f4f96f3fa595bf31b5c7852a5cb5b5f9a1d81a /source/blender/collada/LightExporter.cpp | |
parent | 4ca197ba590331246fbbcf7a78724ae3343ed0fc (diff) |
Fix [#27463] COLLADA light quadratic attenuation exported wrong?
Reported by Pelle Johnsen
Fix falloff import. Point light and Spot light always were set to inverse quad, instead of choosing the proper one based on imported values.
The
Diffstat (limited to 'source/blender/collada/LightExporter.cpp')
-rw-r--r-- | source/blender/collada/LightExporter.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/source/blender/collada/LightExporter.cpp b/source/blender/collada/LightExporter.cpp index 89599c62768..12ccf77f6ad 100644 --- a/source/blender/collada/LightExporter.cpp +++ b/source/blender/collada/LightExporter.cpp @@ -68,20 +68,18 @@ void LightsExporter::operator()(Object *ob) std::string la_name(id_name(la)); COLLADASW::Color col(la->r * la->energy, la->g * la->energy, la->b * la->energy); float e, d, constatt, linatt, quadatt; - float r; d = la->dist; - r = d/2.0f; constatt = 1.0f; if(la->falloff_type==LA_FALLOFF_INVLINEAR) { - linatt = 1.0f / r; + linatt = 1.0f / d; quadatt = 0.0f; } else { linatt = 0.0f; - quadatt = 1.0f / r; + quadatt = 1.0f / (d * d); } // sun |