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
This commit is contained in:
2019-05-12 13:41:23 +02:00
parent 7ad802cf3a
commit 21854575a4
12 changed files with 131 additions and 31 deletions

View File

@@ -1409,16 +1409,9 @@ void BlenderSync::sync_lights(BL::Depsgraph &b_depsgraph, bool update_all)
add_nodes(scene, b_engine, b_data, b_depsgraph, b_scene, graph, b_ntree);
}
else {
float strength = 1.0f;
if (b_light.type() == BL::Light::type_POINT || b_light.type() == BL::Light::type_SPOT ||
b_light.type() == BL::Light::type_AREA) {
strength = 100.0f;
}
EmissionNode *emission = new EmissionNode();
emission->color = get_float3(b_light.color());
emission->strength = strength;
emission->color = make_float3(1.0f, 1.0f, 1.0f);
emission->strength = 1.0f;
graph->add(emission);
ShaderNode *out = graph->output();