Fix Cycles light tree not working with negative light strength
Use absolute value of emission as estimate to make this work. Contributed by Alaska. Differential Revision: https://developer.blender.org/D16718
This commit is contained in:
parent
f95de78ca2
commit
18abc2feaa
|
@ -181,7 +181,9 @@ LightTreePrimitive::LightTreePrimitive(Scene *scene, int prim_id, int object_id)
|
|||
strength *= lamp->get_shader()->emission_estimate;
|
||||
}
|
||||
|
||||
energy = average(strength);
|
||||
/* Use absolute value of energy so lights with negative strength are properly
|
||||
* supported in the light tree. */
|
||||
energy = fabsf(average(strength));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -349,7 +349,7 @@ void Shader::estimate_emission()
|
|||
}
|
||||
|
||||
ShaderInput *surf = graph->output()->input("Surface");
|
||||
emission_estimate = output_estimate_emission(surf->link, emission_is_constant);
|
||||
emission_estimate = fabs(output_estimate_emission(surf->link, emission_is_constant));
|
||||
|
||||
if (is_zero(emission_estimate)) {
|
||||
emission_sampling = EMISSION_SAMPLING_NONE;
|
||||
|
|
Loading…
Reference in New Issue