Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-12 14:41:23 +0300
committerBrecht Van Lommel <brechtvanlommel@gmail.com>2019-05-13 16:56:10 +0300
commit21854575a4ede7d0c16fbe31ac90e66493f607fe (patch)
tree1a196b314cbd7f5eedd16caef6d1de43b0cd2837 /source/blender/draw/engines/eevee/eevee_lights.c
parent7ad802cf3ae500bc72863b6dba0f28a488fce3d1 (diff)
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
Diffstat (limited to 'source/blender/draw/engines/eevee/eevee_lights.c')
-rw-r--r--source/blender/draw/engines/eevee/eevee_lights.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/source/blender/draw/engines/eevee/eevee_lights.c b/source/blender/draw/engines/eevee/eevee_lights.c
index 6e6c23205fe..0e24115f849 100644
--- a/source/blender/draw/engines/eevee/eevee_lights.c
+++ b/source/blender/draw/engines/eevee/eevee_lights.c
@@ -645,7 +645,7 @@ float light_attenuation_radius_get(Light *la, float light_threshold)
/* Compute max light power. */
float power = max_fff(la->r, la->g, la->b);
- power *= fabsf(la->energy);
+ power *= fabsf(la->energy / 100.0f);
power *= max_ff(1.0f, la->spec_fac);
/* Compute the distance (using the inverse square law)
* at which the light power reaches the light_threshold. */
@@ -683,7 +683,7 @@ static float light_shape_power_get(const Light *la, const EEVEE_Light *evli)
/* Make illumination power constant */
if (la->type == LA_AREA) {
power = 1.0f / (evli->sizex * evli->sizey * 4.0f * M_PI) * /* 1/(w*h*Pi) */
- 80.0f; /* XXX : Empirical, Fit cycles power */
+ 0.8f; /* XXX : Empirical, Fit cycles power */
if (ELEM(la->area_shape, LA_AREA_DISK, LA_AREA_ELLIPSE)) {
/* Scale power to account for the lower area of the ellipse compared to the surrounding
* rectangle. */
@@ -691,8 +691,7 @@ static float light_shape_power_get(const Light *la, const EEVEE_Light *evli)
}
}
else if (la->type == LA_SPOT || la->type == LA_LOCAL) {
- power = 1.0f / (4.0f * evli->radius * evli->radius * M_PI * M_PI) * /* 1/(4*r²*Pi²) */
- M_PI * M_PI * 10.0; /* XXX : Empirical, Fit cycles power */
+ power = 1.0f / (4.0f * evli->radius * evli->radius * M_PI * M_PI); /* 1/(4*r²*Pi²) */
/* for point lights (a.k.a radius == 0.0) */
// power = M_PI * M_PI * 0.78; /* XXX : Empirical, Fit cycles power */