Blender Git Commit Log
Git Commits -> Revision 5505ba8
Revision 5505ba8 by Lukas Stockner (master) May 24, 2018, 14:43 (GMT) |
Cycles/Eevee: Implement disk and ellipse shapes for area lamps The implementation is pretty straightforward. In Cycles, sampling the shapes is currently done w.r.t. area instead of solid angle. There is a paper on solid angle sampling for disks [1], but the described algorithm is based on simply sampling the enclosing square and rejecting samples outside of the disk, which is not exactly great for Cycles' RNG (we'd need to setup a LCG for the repeated sampling) and for GPU divergence. Even worse, the algorithm is only defined for disks. For ellipses, the basic idea still works, but a way to analytically calculate the solid angle is required. This is technically possible [2], but the calculation is extremely complex and still requires a lookup table for the Heuman Lambda function. Therefore, I've decided to not implement that for now, we could still look into it later on. In Eevee, the code uses the existing ltc_evaluate_disk to implement the lighting calculations. [1]: "Solid Angle Sampling of Disk and Cylinder Lights" [2]: "Analytical solution for the solid angle subtended at any point by an ellipse via a point source radiation vector potential" Reviewers: sergey, brecht, fclem Differential Revision: https://developer.blender.org/D3171 |
Commit Details:
Full Hash: 5505ba8d4753ee6b3c0101ba3e4abf337546a1b0
Parent Commit: e8c8ff4
Lines Changed: +298, -120
20 Modified Paths:
/intern/cycles/blender/addon/ui.py (+2, -2) (Diff)
/intern/cycles/blender/blender_object.cpp (+18, -4) (Diff)
/intern/cycles/kernel/kernel_light.h (+112, -68) (Diff)
/intern/cycles/render/light.cpp (+10, -3) (Diff)
/intern/cycles/render/light.h (+1, -0) (Diff)
/intern/cycles/util/util_math_intersect.h (+15, -7) (Diff)
/release/scripts/startup/bl_ui/properties_data_lamp.py (+4, -4) (Diff)
/release/scripts/startup/bl_ui/space_view3d.py (+1, -1) (Diff)
/source/blender/draw/engines/eevee/eevee_lights.c (+9, -4) (Diff)
/source/blender/draw/engines/eevee/eevee_private.h (+3, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/bsdf_direct_lib.glsl (+30, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/lamps_lib.glsl (+21, -10) (Diff)
/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl (+4, -1) (Diff)
/source/blender/draw/intern/draw_cache.c (+37, -5) (Diff)
/source/blender/draw/intern/draw_cache.h (+2, -1) (Diff)
/source/blender/draw/modes/object_mode.c (+14, -5) (Diff)
/source/blender/editors/object/object_transform.c (+4, -0) (Diff)
/source/blender/editors/space_view3d/view3d_manipulator_lamp.c (+7, -5) (Diff)
/source/blender/makesdna/DNA_lamp_types.h (+2, -0) (Diff)
/source/blender/makesrna/intern/rna_lamp.c (+2, -0) (Diff)
/intern/cycles/blender/blender_object.cpp (+18, -4) (Diff)
/intern/cycles/kernel/kernel_light.h (+112, -68) (Diff)
/intern/cycles/render/light.cpp (+10, -3) (Diff)
/intern/cycles/render/light.h (+1, -0) (Diff)
/intern/cycles/util/util_math_intersect.h (+15, -7) (Diff)
/release/scripts/startup/bl_ui/properties_data_lamp.py (+4, -4) (Diff)
/release/scripts/startup/bl_ui/space_view3d.py (+1, -1) (Diff)
/source/blender/draw/engines/eevee/eevee_lights.c (+9, -4) (Diff)
/source/blender/draw/engines/eevee/eevee_private.h (+3, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/bsdf_direct_lib.glsl (+30, -0) (Diff)
/source/blender/draw/engines/eevee/shaders/lamps_lib.glsl (+21, -10) (Diff)
/source/blender/draw/engines/eevee/shaders/volumetric_lib.glsl (+4, -1) (Diff)
/source/blender/draw/intern/draw_cache.c (+37, -5) (Diff)
/source/blender/draw/intern/draw_cache.h (+2, -1) (Diff)
/source/blender/draw/modes/object_mode.c (+14, -5) (Diff)
/source/blender/editors/object/object_transform.c (+4, -0) (Diff)
/source/blender/editors/space_view3d/view3d_manipulator_lamp.c (+7, -5) (Diff)
/source/blender/makesdna/DNA_lamp_types.h (+2, -0) (Diff)
/source/blender/makesrna/intern/rna_lamp.c (+2, -0) (Diff)