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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user