blender/intern
Lukas Stockner 213204c229 Cycles: Change sun lamp to have uniform intensity at high angles
This fixes the issue described in https://projects.blender.org/blender/blender/issues/108957.

Instead of modeling distant lights like a disk light at infinity, it models them as cones. This way, the radiance is constant across the entire range of directions that it covers.

For smaller angles, the difference is very subtle, but for very large angles it becomes obvious (here's the file from #108957, the angle is 179°):
| Old | New |
| - | - |
| ![old_bigsun.png](/attachments/4ef8e7a7-1a29-4bdf-a74c-3cfa103bf1e7) | ![new_bigsun.png](/attachments/d53c7749-2672-40b6-9048-ccf2fffceeb7) |

One notable detail is the sampling method: Using `sample_uniform_cone` can increase noise, since the sampling method no longer preserves the stratification of the samples. This is visible in the "light tree multi distant" test scene.
Turns out we can do better, and after a bit of testing I found a way to adapt the concentric Shirley mapping to uniform cone sampling. I hope the comment explains the logic behind it reasonably well.

Here's the result, note that even the noise distribution is the same when using the new sampling:
| Method | Old | New, basic sampling | New, concentric sampling |
| - | - |- | - |
| Image | ![old.png](/attachments/b3258a70-f015-4065-a774-193974cce439) | ![new_basic.png](/attachments/a9008576-0af6-4152-a687-c800fd958bbd) | ![new_concentric.png](/attachments/769b6c43-34bc-434e-a4fd-ce69addd1ba5) |
| Render time (at higher spp)| 9.03sec | 8.79sec | 8.96sec |

I'm not sure if I got the `light->normalized` handling right, since I don't really know what the expectation from Hydra is here.

Co-authored-by: Weizhen Huang <weizhen@blender.org>
Pull Request: https://projects.blender.org/blender/blender/pulls/108996
2023-07-07 17:20:19 +02:00
..
atomic Cleanup: Cmake: use alias target for bf_intern_atomic 2023-07-07 15:37:02 +02:00
audaspace License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
clog License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
cycles Cycles: Change sun lamp to have uniform intensity at high angles 2023-07-07 17:20:19 +02:00
dualcon License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
eigen License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
ffmpeg License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
ghost Cleanup: declare const variables 2023-07-07 16:00:50 +10:00
guardedalloc Cleanup: Cmake: use alias target for bf_intern_atomic 2023-07-07 15:37:02 +02:00
iksolver License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
itasc Update Eigen to version 3.4.0 2023-07-03 15:09:20 +02:00
libc_compat License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
libmv License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
locale License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
mantaflow Cleanup: remove_cc_flag use in CMake 2023-07-05 13:27:21 +10:00
memutil License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
mikktspace Cleanup: Make format 2023-06-15 08:25:49 +02:00
opencolorio Cleanup: simplify struct declarations in C++ 2023-07-02 19:54:26 +10:00
opensubdiv License headers: use SPDX-FileCopyrightText in intern/opensubdiv 2023-06-15 16:47:51 +10:00
openvdb License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
quadriflow License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
renderdoc_dynload License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
rigidbody License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
sky License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
utfconv License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
wayland_dynload License headers: use SPDX-FileCopyrightText in all sources 2023-06-15 13:35:34 +10:00
CMakeLists.txt License headers: use SPDX-FileCopyrightText for CMake files 2023-06-14 23:36:23 +10:00