Blender Git Loki

Git Commits -> Revision eacdcb2

Revision eacdcb2 by Lukas Stockner (master)
June 17, 2020, 19:06 (GMT)
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

Commit Details:

Full Hash: eacdcb2dd80e9e2340fa7a4b8509448b0c72b77a
Parent Commit: d6ef9c1
Lines Changed: +1847, -705

5 Added Paths:

/intern/cycles/kernel/kernel_light_background.h (+448, -0) (View)
/intern/cycles/kernel/kernel_light_common.h (+159, -0) (View)
/intern/cycles/render/image_sky.cpp (+95, -0) (View)
/intern/cycles/render/image_sky.h (+49, -0) (View)
/intern/cycles/util/util_sky_nishita.cpp (+371, -0) (View)

19 Modified Paths:

/intern/cycles/blender/blender_shader.cpp (+8, -0) (Diff)
/intern/cycles/kernel/CMakeLists.txt (+2, -0) (Diff)
/intern/cycles/kernel/kernel_emission.h (+1, -3) (Diff)
/intern/cycles/kernel/kernel_light.h (+4, -496) (Diff)
/intern/cycles/kernel/kernel_montecarlo.h (+10, -0) (Diff)
/intern/cycles/kernel/kernel_types.h (+19, -8) (Diff)
/intern/cycles/kernel/shaders/node_sky_texture.osl (+106, -17) (Diff)
/intern/cycles/kernel/svm/svm_sky.h (+207, -94) (Diff)
/intern/cycles/kernel/svm/svm_types.h (+1, -1) (Diff)
/intern/cycles/render/CMakeLists.txt (+2, -0) (Diff)
/intern/cycles/render/light.cpp (+82, -27) (Diff)
/intern/cycles/render/nodes.cpp (+150, -49) (Diff)
/intern/cycles/render/nodes.h (+9, -0) (Diff)
/intern/cycles/util/CMakeLists.txt (+1, -0) (Diff)
/intern/cycles/util/util_sky_model.h (+24, -0) (Diff)
/source/blender/editors/space_node/drawnode.c (+26, -3) (Diff)
/source/blender/makesdna/DNA_node_types.h (+12, -2) (Diff)
/source/blender/makesrna/intern/rna_nodetree.c (+52, -3) (Diff)
/source/blender/nodes/shader/nodes/node_shader_tex_sky.c (+9, -2) (Diff)
Tehnyt: Miika HämäläinenViimeksi päivitetty: 07.11.2014 14:18MiikaH:n Sivut a.k.a. MiikaHweb | 2003-2021