From 3840e0b2347200ceb414f12deb3436b20d274c66 Mon Sep 17 00:00:00 2001 From: Thomas Dinges Date: Wed, 31 Jul 2013 20:30:37 +0000 Subject: 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. --- intern/cycles/kernel/shaders/node_light_path.osl | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'intern/cycles/kernel/shaders') diff --git a/intern/cycles/kernel/shaders/node_light_path.osl b/intern/cycles/kernel/shaders/node_light_path.osl index 9e3f6c7b4a9..ed3c6969970 100644 --- a/intern/cycles/kernel/shaders/node_light_path.osl +++ b/intern/cycles/kernel/shaders/node_light_path.osl @@ -26,7 +26,8 @@ shader node_light_path( output float IsSingularRay = 0.0, output float IsReflectionRay = 0.0, output float IsTransmissionRay = 0.0, - output float RayLength = 0.0) + output float RayLength = 0.0, + output float RayDepth = 0.0) { IsCameraRay = raytype("camera"); IsShadowRay = raytype("shadow"); @@ -37,5 +38,9 @@ shader node_light_path( IsTransmissionRay = raytype("refraction"); getattribute("path:ray_length", RayLength); + + int ray_depth; + getattribute("path:ray_depth", ray_depth); + RayDepth = (float)ray_depth; } -- cgit v1.2.3