blender/intern/cycles/kernel
Lukas Stockner eacdcb2dd8 Cycles: Add new Sky Texture method including direct sunlight
This commit adds a new model to the Sky Texture node, which is based on a
method by Nishita et al. and works by basically simulating volumetric
scattering in the atmosphere.

By making some approximations (such as only considering single scattering),
we get a fairly simple and fast simulation code that takes into account
Rayleigh and Mie scattering as well as Ozone absorption.

This code is used to precompute a 512x128 texture which is then looked up
during render time, and is fast enough to allow real-time tweaking in the
viewport.

Due to the nature of the simulation, it exposes several parameters that
allow for lots of flexibility in choosing the look and matching real-world
conditions (such as Air/Dust/Ozone density and altitude).

Additionally, the same volumetric approach can be used to compute absorption
of the direct sunlight, so the model also supports adding direct sunlight.
This makes it significantly easier to set up Sun+Sky illumination where
the direction, intensity and color of the sun actually matches the sky.

In order to support properly sampling the direct sun component, the commit
also adds logic for sampling a specific area to the kernel light sampling
code. This is combined with portal and background map sampling using MIS.

This sampling logic works for the common case of having one Sky texture
going into the Background shader, but if a custom input to the Vector
node is used or if there are multiple Sky textures, it falls back to using
only background map sampling (while automatically setting the resolution to
4096x2048 if auto resolution is used).

More infos and preview can be found here:
https://docs.google.com/document/d/1gQta0ygFWXTrl5Pmvl_nZRgUw0mWg0FJeRuNKS36m08/view

Underlying model, implementation and documentation by Marco (@nacioss).
Improvements, cleanup and sun sampling by @lukasstockner.

Differential Revision: https://developer.blender.org/D7896
2020-06-17 21:06:41 +02:00
..
bvh Fix T77106: Cycles crash baking with AO shader node 2020-06-02 06:25:08 +02:00
closure Cleanup: clang format, warning 2020-06-04 01:18:39 +10:00
filter Cleanup: extra semicolons, comma use, undeclared vars 2020-02-11 12:04:50 +11:00
geom Fix T74939: Random Walk subsurface appearance in OptiX does not match other engines 2020-03-26 13:00:09 +01:00
kernels Merge branch 'blender-v2.83-release' 2020-05-27 15:31:03 +02:00
osl Fix T77915: Cycles OSL microfacet closure not working in custom shaders 2020-06-17 14:09:28 +02:00
shaders Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
split Cycles: change volume step size controls, auto adjust based on voxel size 2020-03-18 11:23:05 +01:00
svm Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
CMakeLists.txt Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
kernel_accumulate.h Cycles: move sss and diffuse transmission into diffuse pass 2020-02-25 11:44:47 +01:00
kernel_adaptive_sampling.h Fix T76925: more Cycles OpenCL compile errors with some drivers on Linux 2020-05-25 17:06:10 +02:00
kernel_bake.h Cycles: code refactor to bake using regular render session and tiles 2020-05-15 20:25:24 +02:00
kernel_camera.h Cycles: change perspective depth pass to be more standard 2020-06-02 04:54:44 +02:00
kernel_color.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_compat_cpu.h Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
kernel_compat_cuda.h Fix T75895: Unable to Compile Cycles on NAVI/Linux 2020-04-30 15:04:40 +02:00
kernel_compat_opencl.h Fix T76469: OpenCL 1.2 Compilation 2020-05-07 14:34:50 +02:00
kernel_compat_optix.h Fix T75895: Unable to Compile Cycles on NAVI/Linux 2020-04-30 15:04:40 +02:00
kernel_differential.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_emission.h Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
kernel_film.h Fix T76925: Cycles OpenCL compile error with some drivers on Linux 2020-05-22 21:50:24 +02:00
kernel_globals.h Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00
kernel_id_passes.h Cleanup: comments (long lines) in cycles 2019-05-01 21:41:07 +10:00
kernel_jitter.h Fix T74423: Cycles rendering artifacts with CUDA 10.2 2020-04-22 16:40:52 +02:00
kernel_light_background.h Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
kernel_light_common.h Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
kernel_light.h Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
kernel_math.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_montecarlo.h Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
kernel_passes.h Cycles: change perspective depth pass to be more standard 2020-06-02 04:54:44 +02:00
kernel_path_branched.h Fix T76925: more Cycles OpenCL compile errors with some drivers on Linux 2020-05-25 17:06:10 +02:00
kernel_path_common.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_path_state.h Cycles: Track specular throughput to account for reflection color in denoising albedo pass 2020-02-06 03:37:48 +01:00
kernel_path_subsurface.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_path_surface.h Cycles: perform clamping per light contribution instead of whole path 2019-12-12 13:04:43 +01:00
kernel_path_volume.h Cycles: perform clamping per light contribution instead of whole path 2019-12-12 13:04:43 +01:00
kernel_path.h Fix T76925: more Cycles OpenCL compile errors with some drivers on Linux 2020-05-25 17:06:10 +02:00
kernel_profiling.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_projection.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
kernel_queues.h Cleanup: spelling, repeated words 2019-11-25 00:55:11 +11:00
kernel_random.h Fix T74423: Cycles rendering artifacts with CUDA 10.2 2020-04-22 16:40:52 +02:00
kernel_shader.h Cleanup: tweak Cycles #includes in preparation for clang-format sorting 2020-03-06 14:44:42 +01:00
kernel_shadow.h Fix T72470: OptiX render fails with scene with many translucent planes on Linux. 2020-01-10 15:47:51 +01:00
kernel_subsurface.h Fix T74939: Random Walk subsurface appearance in OptiX does not match other engines 2020-03-26 13:00:09 +01:00
kernel_textures.h Cycles: change volume step size controls, auto adjust based on voxel size 2020-03-18 11:23:05 +01:00
kernel_types.h Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
kernel_volume.h Volumes: add render settings for volume datablock 2020-03-18 11:23:05 +01:00
kernel_work_stealing.h Fix T76925: more Cycles OpenCL compile errors with some drivers on Linux 2020-05-25 17:06:10 +02:00
kernel_write_passes.h Cycles: support for custom shader AOVs 2019-12-10 20:44:46 +01:00
kernel.h Cleanup: make format after SortedIncludes change 2020-03-19 09:33:58 +01:00