Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Dinges <blender@dingto.org>2013-08-01 00:30:37 +0400
committerThomas Dinges <blender@dingto.org>2013-08-01 00:30:37 +0400
commit3840e0b2347200ceb414f12deb3436b20d274c66 (patch)
treef61c6dc0087edc69b50acf29aae6dc4712d3aeb2 /intern/cycles/kernel/svm
parentc15ae082bb3bcb379c343aa770601b49c0866583 (diff)
Cycles / Ray Depth:
* Added a Ray Depth output to the Light Path node, which gives the user access to the current bounce. This can be used to limit the maximum ray bounce on a per shader basis. Another use case is to restrict light influence with this, to have a lamp only contribute to the direct lighting. http://wiki.blender.org/index.php/Doc:2.6/Manual/Render/Cycles/Nodes/More#Light_Path This is part of my GSoC 2013 project. SVN merge of r58091 and r58772 from soc-2013-dingto.
Diffstat (limited to 'intern/cycles/kernel/svm')
-rw-r--r--intern/cycles/kernel/svm/svm_light_path.h1
-rw-r--r--intern/cycles/kernel/svm/svm_types.h3
2 files changed, 3 insertions, 1 deletions
diff --git a/intern/cycles/kernel/svm/svm_light_path.h b/intern/cycles/kernel/svm/svm_light_path.h
index b29dc9cbd45..0f16ef83894 100644
--- a/intern/cycles/kernel/svm/svm_light_path.h
+++ b/intern/cycles/kernel/svm/svm_light_path.h
@@ -34,6 +34,7 @@ __device void svm_node_light_path(ShaderData *sd, float *stack, uint type, uint
case NODE_LP_transmission: info = (path_flag & PATH_RAY_TRANSMIT)? 1.0f: 0.0f; break;
case NODE_LP_backfacing: info = (sd->flag & SD_BACKFACING)? 1.0f: 0.0f; break;
case NODE_LP_ray_length: info = sd->ray_length; break;
+ case NODE_LP_ray_depth: info = (float)sd->ray_depth; break;
}
stack_store_float(stack, out_offset, info);
diff --git a/intern/cycles/kernel/svm/svm_types.h b/intern/cycles/kernel/svm/svm_types.h
index e5b3e2b972f..85719265292 100644
--- a/intern/cycles/kernel/svm/svm_types.h
+++ b/intern/cycles/kernel/svm/svm_types.h
@@ -153,7 +153,8 @@ typedef enum NodeLightPath {
NODE_LP_reflection,
NODE_LP_transmission,
NODE_LP_backfacing,
- NODE_LP_ray_length
+ NODE_LP_ray_length,
+ NODE_LP_ray_depth
} NodeLightPath;
typedef enum NodeLightFalloff {