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:
authorClément Foucault <foucault.clem@gmail.com>2021-03-19 14:07:23 +0300
committerClément Foucault <foucault.clem@gmail.com>2021-03-19 23:11:06 +0300
commit884f934a853f7043a7e5a6ea380d560c858a78b7 (patch)
tree14c4441579169bcc50de145d24dbff5ab206200a /source/blender/makesrna/intern
parentfb3e5b7f986e7215c6488c2b93db8559e84cfb98 (diff)
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.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r--source/blender/makesrna/intern/rna_light.c16
1 files changed, 15 insertions, 1 deletions
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,