2 * Copyright 2011-2013 Blender Foundation
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
8 * http://www.apache.org/licenses/LICENSE-2.0
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
17 #include "stdcycles.h"
19 shader node_light_path(output float IsCameraRay = 0.0,
20 output float IsShadowRay = 0.0,
21 output float IsDiffuseRay = 0.0,
22 output float IsGlossyRay = 0.0,
23 output float IsSingularRay = 0.0,
24 output float IsReflectionRay = 0.0,
25 output float IsTransmissionRay = 0.0,
26 output float IsVolumeScatterRay = 0.0,
27 output float RayLength = 0.0,
28 output float RayDepth = 0.0,
29 output float DiffuseDepth = 0.0,
30 output float GlossyDepth = 0.0,
31 output float TransparentDepth = 0.0,
32 output float TransmissionDepth = 0.0)
34 IsCameraRay = raytype("camera");
35 IsShadowRay = raytype("shadow");
36 IsDiffuseRay = raytype("diffuse");
37 IsGlossyRay = raytype("glossy");
38 IsSingularRay = raytype("singular");
39 IsReflectionRay = raytype("reflection");
40 IsTransmissionRay = raytype("refraction");
41 IsVolumeScatterRay = raytype("volume_scatter");
43 getattribute("path:ray_length", RayLength);
46 getattribute("path:ray_depth", ray_depth);
47 RayDepth = (float)ray_depth;
50 getattribute("path:diffuse_depth", diffuse_depth);
51 DiffuseDepth = (float)diffuse_depth;
54 getattribute("path:glossy_depth", glossy_depth);
55 GlossyDepth = (float)glossy_depth;
57 int transparent_depth;
58 getattribute("path:transparent_depth", transparent_depth);
59 TransparentDepth = (float)transparent_depth;
61 int transmission_depth;
62 getattribute("path:transmission_depth", transmission_depth);
63 TransmissionDepth = (float)transmission_depth;