Sample as Lamp option for world shaders, to enable multiple importance sampling.
authorBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 20 Jan 2012 17:49:17 +0000 (17:49 +0000)
committerBrecht Van Lommel <brechtvanlommel@pandora.be>
Fri, 20 Jan 2012 17:49:17 +0000 (17:49 +0000)
commit58733012579bef18c0fe26608a24f8c47eecdcd4
tree3ea3ab07a8ab0920f197fee933d23b17a801d8fd
parentbddc01a7e197b651a74ec0870e9b27427aaeb890
Sample as Lamp option for world shaders, to enable multiple importance sampling.

By default lighting from the world is computed solely with indirect light
sampling. However for more complex environment maps this can be too noisy, as
sampling the BSDF may not easily find the highlights in the environment map
image. By enabling this option, the world background will be sampled as a lamp,
with lighter parts automatically given more samples.

Map Resolution specifies the size of the importance map (res x res). Before
rendering starts, an importance map is generated by "baking" a grayscale image
from the world shader. This will then be used to determine which parts of the
background are light and so should receive more samples than darker parts.
Higher resolutions will result in more accurate sampling but take more setup
time and memory.

Patch by Mike Farnsworth, thanks!
26 files changed:
intern/cycles/blender/addon/properties.py
intern/cycles/blender/addon/ui.py
intern/cycles/blender/blender_object.cpp
intern/cycles/blender/blender_shader.cpp
intern/cycles/blender/blender_sync.h
intern/cycles/device/device_cpu.cpp
intern/cycles/kernel/kernel.cl
intern/cycles/kernel/kernel.cpp
intern/cycles/kernel/kernel.cu
intern/cycles/kernel/kernel.h
intern/cycles/kernel/kernel_compat_cpu.h
intern/cycles/kernel/kernel_compat_cuda.h
intern/cycles/kernel/kernel_differential.h
intern/cycles/kernel/kernel_displace.h
intern/cycles/kernel/kernel_emission.h
intern/cycles/kernel/kernel_light.h
intern/cycles/kernel/kernel_montecarlo.h
intern/cycles/kernel/kernel_optimized.cpp
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_textures.h
intern/cycles/kernel/kernel_types.h
intern/cycles/kernel/svm/svm_image.h
intern/cycles/render/light.cpp
intern/cycles/render/light.h
intern/cycles/render/mesh_displace.cpp
intern/cycles/render/scene.h