diff options
author | Lukas Stockner <lukas.stockner@freenet.de> | 2018-05-24 04:50:16 +0300 |
---|---|---|
committer | Lukas Stockner <lukas.stockner@freenet.de> | 2018-05-24 17:43:47 +0300 |
commit | 5505ba8d4753ee6b3c0101ba3e4abf337546a1b0 (patch) | |
tree | 1c0fdbed36127f670e8aa0d49a53f72988cc34c5 /source/blender/editors/space_view3d/view3d_ops.c | |
parent | e8c8ff4f86c276e4dca884ff1a411fcbbf003fed (diff) |
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
Diffstat (limited to 'source/blender/editors/space_view3d/view3d_ops.c')
0 files changed, 0 insertions, 0 deletions