diff options
author | Thomas Dinges <blender@dingto.org> | 2016-01-07 01:38:13 +0300 |
---|---|---|
committer | Thomas Dinges <blender@dingto.org> | 2016-01-07 01:43:29 +0300 |
commit | 83e73a2100688655f0eb2df5cbfac2ca1f051fff (patch) | |
tree | 76f1cd502187544777b61fa55f5695b2503993a8 /source/blender/gpu | |
parent | be28706bacfb95e7c3c1b58b183acda0e35977f8 (diff) |
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. :)
Diffstat (limited to 'source/blender/gpu')
-rw-r--r-- | source/blender/gpu/shaders/gpu_shader_material.glsl | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/source/blender/gpu/shaders/gpu_shader_material.glsl b/source/blender/gpu/shaders/gpu_shader_material.glsl index 5b62739b0eb..dfb1af0e863 100644 --- a/source/blender/gpu/shaders/gpu_shader_material.glsl +++ b/source/blender/gpu/shaders/gpu_shader_material.glsl @@ -2560,7 +2560,8 @@ void node_light_path( out float is_transmission_ray, out float ray_length, out float ray_depth, - out float transparent_depth) + out float transparent_depth, + out float transmission_depth) { is_camera_ray = 1.0; is_shadow_ray = 0.0; @@ -2572,6 +2573,7 @@ void node_light_path( ray_length = 1.0; ray_depth = 1.0; transparent_depth = 1.0; + transmission_depth = 1.0; } void node_light_falloff(float strength, float tsmooth, out float quadratic, out float linear, out float constant) |