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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-02 21:03:46 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2012-05-02 21:03:46 +0400
commitd64661b5078cd4781bd58fce6fadedac511c4132 (patch)
tree08abb98017e41cd6f7bfbd1f2ca87a2166f91eea /intern/cycles/kernel/svm/svm_light_path.h
parent89f554fd24abb6c3986090933f771da267345b96 (diff)
Cycles: add Ray Length output to Light Path node. This gives the distance travelled
by the last light ray. One use case for this might be to do absorption. Patch #31232 by Agustin benavidez, see this blog post for details: http://agus3d.blogspot.com.ar/2012/05/blender-cycles-ray-length-node-output.html
Diffstat (limited to 'intern/cycles/kernel/svm/svm_light_path.h')
-rw-r--r--intern/cycles/kernel/svm/svm_light_path.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/intern/cycles/kernel/svm/svm_light_path.h b/intern/cycles/kernel/svm/svm_light_path.h
index 1b13fd93a0f..ebbcb5be61f 100644
--- a/intern/cycles/kernel/svm/svm_light_path.h
+++ b/intern/cycles/kernel/svm/svm_light_path.h
@@ -33,6 +33,7 @@ __device void svm_node_light_path(ShaderData *sd, float *stack, uint type, uint
case NODE_LP_reflection: info = (path_flag & PATH_RAY_REFLECT)? 1.0f: 0.0f; break;
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;
}
stack_store_float(stack, out_offset, info);