Fix wrong conversion from power to radiance of area lights #109153

Merged
Weizhen Huang merged 10 commits from weizhen/blender:fix_area_light_scaling into main 2023-07-07 17:03:09 +02:00
2 changed files with 10 additions and 11 deletions
Showing only changes of commit 15a4c7bea9 - Show all commits

View File

@ -10,7 +10,6 @@
#include "CLG_log.h"
#include "DNA_light_types.h"
#include "DNA_modifier_types.h"
#include "DNA_movieclip_types.h"
@ -36,17 +35,8 @@
// static CLG_LogRef LOG = {"blo.readfile.doversion"};
void do_versions_after_linking_400(FileData * /*fd*/, Main *bmain)
void do_versions_after_linking_400(FileData * /*fd*/, Main * /*bmain*/)
{
if (!MAIN_VERSION_ATLEAST(bmain, 400, 8)) {
/* Fix area light scaling. */
LISTBASE_FOREACH (Light *, light, &bmain->lights) {
if (light->type == LA_AREA) {
light->energy *= M_PI_4;
}
}
}
/**
* Versioning code until next subversion bump goes here.
*

View File

@ -1650,4 +1650,13 @@ void do_versions_after_linking_cycles(Main *bmain)
}
}
}
if (!MAIN_VERSION_ATLEAST(bmain, 400, 8)) {
/* Fix area light scaling. */
LISTBASE_FOREACH (Light *, light, &bmain->lights) {
if (light->type == LA_AREA) {
light->energy *= M_PI_4;
}
}
}
}