From 21854575a4ede7d0c16fbe31ac90e66493f607fe Mon Sep 17 00:00:00 2001 From: Brecht Van Lommel Date: Sun, 12 May 2019 13:41:23 +0200 Subject: Cycles/Eevee: unify light strength and color Cycles lights now use strength and color properties of the light outside of the shading nodes, just like Eevee. The shading nodes then act as a multiplier on this, and become optional unless textures, fallof or other effects are desired. Backwards compatibility is not exact, as we can't be sure which renderer the .blend was designed for or even if it was designed for a single one. If the render engine in the active scene is set to Cycles, lights are converted to ensure overall light strength remains the same, and removing unnecessary shader node setups that only included a single emission node. If the engine is set to Eevee, we increase strength to remove the automatic 100x multiplier that was there to match Cycles. Differential Revision: https://developer.blender.org/D4588 --- intern/cycles/kernel/kernel_emission.h | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'intern/cycles/kernel/kernel_emission.h') diff --git a/intern/cycles/kernel/kernel_emission.h b/intern/cycles/kernel/kernel_emission.h index f2eaa7b50a5..34300543f91 100644 --- a/intern/cycles/kernel/kernel_emission.h +++ b/intern/cycles/kernel/kernel_emission.h @@ -90,6 +90,11 @@ ccl_device_noinline float3 direct_emissive_eval(KernelGlobals *kg, eval *= ls->eval_fac; + if (ls->lamp != LAMP_NONE) { + const ccl_global KernelLight *klight = &kernel_tex_fetch(__lights, ls->lamp); + eval *= make_float3(klight->strength[0], klight->strength[1], klight->strength[2]); + } + return eval; } -- cgit v1.2.3