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 11 additions and 10 deletions
Showing only changes of commit 9485654f96 - Show all commits

View File

@ -10,6 +10,7 @@
#include "CLG_log.h"
#include "DNA_light_types.h"
#include "DNA_modifier_types.h"
#include "DNA_movieclip_types.h"
@ -35,8 +36,17 @@
// 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,13 +1650,4 @@ 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;
}
}
}
}