This repository has been archived on 2023-10-09. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
blender-archive/intern/cycles/render/CMakeLists.txt
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

132 lines
1.8 KiB
CMake

set(INC
..
../../glew-mx
)
set(INC_SYS
${GLEW_INCLUDE_DIR}
)
set(SRC
attribute.cpp
background.cpp
bake.cpp
buffers.cpp
camera.cpp
colorspace.cpp
constant_fold.cpp
coverage.cpp
denoising.cpp
film.cpp
geometry.cpp
graph.cpp
hair.cpp
image.cpp
image_oiio.cpp
image_sky.cpp
image_vdb.cpp
integrator.cpp
jitter.cpp
light.cpp
merge.cpp
mesh.cpp
mesh_displace.cpp
mesh_subdivision.cpp
mesh_volume.cpp
nodes.cpp
object.cpp
osl.cpp
particles.cpp
curves.cpp
scene.cpp
session.cpp
shader.cpp
sobol.cpp
stats.cpp
svm.cpp
tables.cpp
tile.cpp
)
set(SRC_HEADERS
attribute.h
bake.h
background.h
buffers.h
camera.h
colorspace.h
constant_fold.h
coverage.h
denoising.h
film.h
geometry.h
graph.h
hair.h
image.h
image_oiio.h
image_sky.h
image_vdb.h
integrator.h
light.h
jitter.h
merge.h
mesh.h
nodes.h
object.h
osl.h
particles.h
curves.h
scene.h
session.h
shader.h
sobol.h
stats.h
svm.h
tables.h
tile.h
)
set(LIB
cycles_bvh
cycles_device
cycles_subd
cycles_util
)
if(WITH_CYCLES_OSL)
list(APPEND LIB
cycles_kernel_osl
)
SET_PROPERTY(SOURCE osl.cpp PROPERTY COMPILE_FLAGS ${RTTI_DISABLE_FLAGS})
endif()
if(WITH_OPENCOLORIO)
add_definitions(-DWITH_OCIO)
include_directories(
SYSTEM
${OPENCOLORIO_INCLUDE_DIRS}
)
if(WIN32)
add_definitions(-DOpenColorIO_STATIC)
endif()
endif()
if(WITH_OPENVDB)
add_definitions(-DWITH_OPENVDB ${OPENVDB_DEFINITIONS})
list(APPEND INC_SYS
${OPENVDB_INCLUDE_DIRS}
)
list(APPEND LIB
${OPENVDB_LIBRARIES}
)
endif()
include_directories(${INC})
include_directories(SYSTEM ${INC_SYS})
add_definitions(${GL_DEFINITIONS})
cycles_add_library(cycles_render "${LIB}" ${SRC} ${SRC_HEADERS})