Fix T49180: Cycles MIS Map for Animated Environment Texture Movie Doesn't Update on Frame Change
Not really ideal fix at all, but we are at RC today, so better to play really safe.
This commit is contained in:
parent
fce8f24628
commit
b399a6d33f
Notes:
blender-bot
2023-05-03 10:14:48 +02:00
Referenced by commit 8825a8e951
, Squashed commit of the following:
Referenced by issue #49180, Cycles Multiple Importance Map for Animated Environment Texture Movie Doesn't Update on Frame Change
|
@ -177,6 +177,16 @@ LightManager::~LightManager()
|
|||
{
|
||||
}
|
||||
|
||||
bool LightManager::has_background_light(Scene *scene)
|
||||
{
|
||||
foreach(Light *light, scene->lights) {
|
||||
if(light->type == LIGHT_BACKGROUND) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void LightManager::disable_ineffective_light(Device *device, Scene *scene)
|
||||
{
|
||||
/* Make all lights enabled by default, and perform some preliminary checks
|
||||
|
|
|
@ -91,6 +91,9 @@ public:
|
|||
|
||||
void tag_update(Scene *scene);
|
||||
|
||||
/* Check whether there is a background light. */
|
||||
bool has_background_light(Scene *scene);
|
||||
|
||||
protected:
|
||||
/* Optimization: disable light which is either unsupported or
|
||||
* which doesn't contribute to the scene or which is only used for MIS
|
||||
|
|
|
@ -221,6 +221,16 @@ void Shader::tag_update(Scene *scene)
|
|||
if(use_mis && has_surface_emission)
|
||||
scene->light_manager->need_update = true;
|
||||
|
||||
/* Special handle of background MIS light for now: for some reason it
|
||||
* has use_mis set to false. We are quite close to release now, so
|
||||
* better to be safe.
|
||||
*/
|
||||
if(this == scene->default_background &&
|
||||
scene->light_manager->has_background_light(scene))
|
||||
{
|
||||
scene->light_manager->need_update = true;
|
||||
}
|
||||
|
||||
/* quick detection of which kind of shaders we have to avoid loading
|
||||
* e.g. surface attributes when there is only a volume shader. this could
|
||||
* be more fine grained but it's better than nothing */
|
||||
|
|
Loading…
Reference in New Issue