blender/intern/cycles/kernel/svm
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
..
svm_ao.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_aov.h Cycles: support for custom shader AOVs 2019-12-10 20:44:46 +01:00
svm_attribute.h Shading: Add Vertex Color node. 2019-09-12 17:42:13 +02:00
svm_bevel.h Cycles: Add OptiX acceleration structure compaction 2019-12-09 14:32:12 +01:00
svm_blackbody.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_brick.h Cycles: inline more functions on the GPU 2019-08-26 10:26:53 +02:00
svm_brightness.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_bump.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_camera.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_checker.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_clamp.h Shader Nodes: Add Interpolation modes to Map Range node 2019-12-07 12:52:42 +00:00
svm_closure.h Cycles: Refactor microfacet BSDFs to remove separate anisotropy code 2020-05-15 00:52:57 +02:00
svm_color_util.h Fix T70605: incorrect darken and lighten rgb mix mode 2019-10-15 17:31:44 +02:00
svm_convert.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_displace.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_fractal_noise.h Shading: add Roughness input to Noise and Wave texture nodes 2020-04-09 21:48:03 +02:00
svm_fresnel.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_gamma.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_geometry.h Shading: Add object color to Object Info node. 2019-08-22 14:26:09 +02:00
svm_gradient.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_hsv.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_ies.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_image.h Cleanup: remove unused Cycles kernel feature flags, replace by node levels 2020-03-24 16:49:46 +01:00
svm_invert.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_light_path.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_magic.h Cycles: inline more functions on the GPU 2019-08-26 10:26:53 +02:00
svm_map_range.h Shader Nodes: Add Interpolation modes to Map Range node 2019-12-07 12:52:42 +00:00
svm_mapping_util.h Shading: Rewrite Mapping node with dynamic inputs. 2019-09-04 23:17:13 +02:00
svm_mapping.h Shading: Rewrite Mapping node with dynamic inputs. 2019-09-04 23:17:13 +02:00
svm_math_util.h Cleanup: clang-format 2020-02-15 10:40:41 +11:00
svm_math.h Fix Optix build error after recent changes 2020-03-27 14:26:26 +01:00
svm_mix.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_musgrave.h Shading: Extend Musgrave node to other dimensions. 2019-09-09 21:06:55 +02:00
svm_noise.h Cycles: AVX implantation of Perlin noise. 2020-04-01 14:48:01 +02:00
svm_noisetex.h Shading: add Roughness input to Noise and Wave texture nodes 2020-04-09 21:48:03 +02:00
svm_normal.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_ramp_util.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_ramp.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_sepcomb_hsv.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_sepcomb_vector.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_sky.h Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
svm_tex_coord.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_types.h Cycles: Add new Sky Texture method including direct sunlight 2020-06-17 21:06:41 +02:00
svm_value.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_vector_rotate.h Shading: Add invert option to Vector Rotate Node 2020-03-02 12:49:19 +00:00
svm_vector_transform.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm_vertex_color.h Shading: Add Vertex Color node. 2019-09-12 17:42:13 +02:00
svm_voronoi.h Fix T75895: Unable to Compile Cycles on NAVI/Linux 2020-04-30 15:04:40 +02:00
svm_voxel.h Cycles: support for different 3D transform per volume grid 2020-03-18 11:23:05 +01:00
svm_wave.h Shading: add Roughness input to Noise and Wave texture nodes 2020-04-09 21:48:03 +02:00
svm_wavelength.h ClangFormat: apply to source, most of intern 2019-04-17 06:21:24 +02:00
svm_white_noise.h Shading: Add color output to White Noise node 2020-01-27 15:47:51 +00:00
svm_wireframe.h Cycles: change svm node decoding for more efficient code generation on GPU 2019-08-26 10:26:53 +02:00
svm.h Cycles: slightly improve OpenCL performance by reordering SVM enum values 2020-03-24 16:49:46 +01:00