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/blenloader/intern/versioning_290.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'source/blender/blenloader') diff --git a/source/blender/blenloader/intern/versioning_290.c b/source/blender/blenloader/intern/versioning_290.c index d8f798a11cd..0c6817542d1 100644 --- a/source/blender/blenloader/intern/versioning_290.c +++ b/source/blender/blenloader/intern/versioning_290.c @@ -1963,5 +1963,12 @@ void blo_do_versions_290(FileData *fd, Library *UNUSED(lib), Main *bmain) arm->axes_position = 1.0; } } + + /* Initialize the spread parameter for area lights*/ + if (!DNA_struct_elem_find(fd->filesdna, "Lamp", "float", "area_spread")) { + LISTBASE_FOREACH (Light *, la, &bmain->lights) { + la->area_spread = DEG2RADF(180.0f); + } + } } } -- cgit v1.2.3