From a4260ac21977acd5b9cd792f2a68c3aa78dd91cd Mon Sep 17 00:00:00 2001 From: Matteo Falduto Date: Thu, 1 Apr 2021 05:35:56 +0200 Subject: Cycles: add a spread setting for area lights This simulates the effect of a honeycomb or grid placed in front of a softbox. In practice, it works by attenuating rays coming off-angle as a function of the provided spread angle parameter. Setting the parameter to 180 degrees poses no restrictions to the rays, making the light behave the same way as before this patch. The total light power is normalized based on the spread angle, so that the light strength remains the same. Differential Revision: https://developer.blender.org/D10594 --- source/blender/makesrna/intern/rna_light.c | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'source/blender/makesrna') diff --git a/source/blender/makesrna/intern/rna_light.c b/source/blender/makesrna/intern/rna_light.c index bb99e5c6c1d..0593db0dd56 100644 --- a/source/blender/makesrna/intern/rna_light.c +++ b/source/blender/makesrna/intern/rna_light.c @@ -480,6 +480,15 @@ static void rna_def_area_light(BlenderRNA *brna) "Size Y", "Size of the area of the area light in the Y direction for rectangle shapes"); RNA_def_property_update(prop, 0, "rna_Light_draw_update"); + + prop = RNA_def_property(srna, "spread", PROP_FLOAT, PROP_ANGLE); + RNA_def_property_float_sdna(prop, NULL, "area_spread"); + RNA_def_property_range(prop, DEG2RADF(1.0f), DEG2RADF(180.0f)); + RNA_def_property_ui_text( + prop, + "Spread", + "How widely the emitted light fans out, as in the case of a gridded softbox"); + RNA_def_property_update(prop, 0, "rna_Light_draw_update"); } static void rna_def_spot_light(BlenderRNA *brna) -- cgit v1.2.3