From 884f934a853f7043a7e5a6ea380d560c858a78b7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Foucault?= Date: Fri, 19 Mar 2021 12:07:23 +0100 Subject: EEVEE: Lights: Add Volume and diffuse light power slider This adds 2 new sliders for light objects that modulates the diffuse light and the volume light intensities. This also changes the way volume light is computed using point lamp representation. We use "Point Light Attenuation Without Singularity" from Cem Yuksel instead of the usual inverse square law. --- source/blender/makesrna/intern/rna_light.c | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'source/blender/makesrna/intern') diff --git a/source/blender/makesrna/intern/rna_light.c b/source/blender/makesrna/intern/rna_light.c index 52ebd5af993..bb99e5c6c1d 100644 --- a/source/blender/makesrna/intern/rna_light.c +++ b/source/blender/makesrna/intern/rna_light.c @@ -150,11 +150,25 @@ static void rna_def_light(BlenderRNA *brna) prop = RNA_def_property(srna, "specular_factor", PROP_FLOAT, PROP_FACTOR); RNA_def_property_float_sdna(prop, NULL, "spec_fac"); - RNA_def_property_range(prop, 0.0f, 9999.0f); + RNA_def_property_range(prop, 0.0f, FLT_MAX); RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2); RNA_def_property_ui_text(prop, "Specular Factor", "Specular reflection multiplier"); RNA_def_property_update(prop, 0, "rna_Light_update"); + prop = RNA_def_property(srna, "diffuse_factor", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "diff_fac"); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2); + RNA_def_property_ui_text(prop, "Diffuse Factor", "Diffuse reflection multiplier"); + RNA_def_property_update(prop, 0, "rna_Light_update"); + + prop = RNA_def_property(srna, "volume_factor", PROP_FLOAT, PROP_FACTOR); + RNA_def_property_float_sdna(prop, NULL, "volume_fac"); + RNA_def_property_range(prop, 0.0f, FLT_MAX); + RNA_def_property_ui_range(prop, 0.0f, 1.0f, 0.01, 2); + RNA_def_property_ui_text(prop, "Volume Factor", "Volume light multiplier"); + RNA_def_property_update(prop, 0, "rna_Light_update"); + prop = RNA_def_property(srna, "use_custom_distance", PROP_BOOLEAN, PROP_NONE); RNA_def_property_boolean_sdna(prop, NULL, "mode", LA_CUSTOM_ATTENUATION); RNA_def_property_ui_text(prop, -- cgit v1.2.3