Cycles: Refactor how we pass bounce info to light path node.
authorThomas Dinges <blender@dingto.org>
Wed, 6 Jan 2016 22:38:13 +0000 (23:38 +0100)
committerThomas Dinges <blender@dingto.org>
Wed, 6 Jan 2016 22:43:29 +0000 (23:43 +0100)
commit83e73a2100688655f0eb2df5cbfac2ca1f051fff
tree76f1cd502187544777b61fa55f5695b2503993a8
parentbe28706bacfb95e7c3c1b58b183acda0e35977f8
Cycles: Refactor how we pass bounce info to light path node.

This commit changes the way how we pass bounce information to the Light
Path node. Instead of manualy copying the bounces into ShaderData, we now
directly pass PathState. This reduces the arguments that we need to pass
around and also makes it easier to extend the feature.

This commit also exposes the Transmission Bounce Depth to the Light Path
node. It works similar to the Transparent Depth Output: Replace a
Transmission lightpath after X bounces with another shader, e.g a Diffuse
one. This can be used to avoid black surfaces, due to low amount of max
bounces.

Reviewed by Sergey and Brecht, thanks for some hlp with this.

I tested compilation and usage on CPU (SVM and OSL), CUDA, OpenCL Split
and Mega kernel. Hopefully this covers all devices. :)
29 files changed:
intern/cycles/device/device_opencl.cpp
intern/cycles/kernel/kernel_bake.h
intern/cycles/kernel/kernel_emission.h
intern/cycles/kernel/kernel_path.h
intern/cycles/kernel/kernel_path_branched.h
intern/cycles/kernel/kernel_path_state.h
intern/cycles/kernel/kernel_path_surface.h
intern/cycles/kernel/kernel_path_volume.h
intern/cycles/kernel/kernel_shader.h
intern/cycles/kernel/kernel_shaderdata_vars.h
intern/cycles/kernel/kernel_shadow.h
intern/cycles/kernel/kernel_subsurface.h
intern/cycles/kernel/kernel_volume.h
intern/cycles/kernel/kernels/opencl/kernel_data_init.cl
intern/cycles/kernel/osl/osl_services.cpp
intern/cycles/kernel/osl/osl_services.h
intern/cycles/kernel/osl/osl_shader.cpp
intern/cycles/kernel/osl/osl_shader.h
intern/cycles/kernel/shaders/node_light_path.osl
intern/cycles/kernel/split/kernel_data_init.h
intern/cycles/kernel/split/kernel_direct_lighting.h
intern/cycles/kernel/split/kernel_lamp_emission.h
intern/cycles/kernel/split/kernel_shader_eval.h
intern/cycles/kernel/svm/svm.h
intern/cycles/kernel/svm/svm_light_path.h
intern/cycles/kernel/svm/svm_types.h
intern/cycles/render/nodes.cpp
source/blender/gpu/shaders/gpu_shader_material.glsl
source/blender/nodes/shader/nodes/node_shader_light_path.c