2022-02-11 13:53:21 +01:00
|
|
|
/* SPDX-License-Identifier: Apache-2.0
|
|
|
|
|
* Copyright 2011-2022 Blender Foundation */
|
2011-04-27 11:58:34 +00:00
|
|
|
|
2020-02-11 21:40:23 -07:00
|
|
|
#include "stdcycles.h"
|
2011-04-27 11:58:34 +00:00
|
|
|
|
|
|
|
|
shader node_light_path(output float IsCameraRay = 0.0,
|
|
|
|
|
output float IsShadowRay = 0.0,
|
|
|
|
|
output float IsDiffuseRay = 0.0,
|
|
|
|
|
output float IsGlossyRay = 0.0,
|
2011-09-01 15:53:36 +00:00
|
|
|
output float IsSingularRay = 0.0,
|
2011-04-27 11:58:34 +00:00
|
|
|
output float IsReflectionRay = 0.0,
|
2012-10-16 22:42:05 +00:00
|
|
|
output float IsTransmissionRay = 0.0,
|
2013-12-28 01:54:44 +01:00
|
|
|
output float IsVolumeScatterRay = 0.0,
|
2013-07-31 20:30:37 +00:00
|
|
|
output float RayLength = 0.0,
|
2014-04-21 14:20:29 +02:00
|
|
|
output float RayDepth = 0.0,
|
2016-12-06 16:15:36 +01:00
|
|
|
output float DiffuseDepth = 0.0,
|
|
|
|
|
output float GlossyDepth = 0.0,
|
2016-01-06 23:38:13 +01:00
|
|
|
output float TransparentDepth = 0.0,
|
|
|
|
|
output float TransmissionDepth = 0.0)
|
2011-04-27 11:58:34 +00:00
|
|
|
{
|
|
|
|
|
IsCameraRay = raytype("camera");
|
|
|
|
|
IsShadowRay = raytype("shadow");
|
|
|
|
|
IsDiffuseRay = raytype("diffuse");
|
|
|
|
|
IsGlossyRay = raytype("glossy");
|
2011-09-01 15:53:36 +00:00
|
|
|
IsSingularRay = raytype("singular");
|
2011-04-27 11:58:34 +00:00
|
|
|
IsReflectionRay = raytype("reflection");
|
|
|
|
|
IsTransmissionRay = raytype("refraction");
|
2013-12-28 01:54:44 +01:00
|
|
|
IsVolumeScatterRay = raytype("volume_scatter");
|
2012-10-16 22:42:05 +00:00
|
|
|
|
2012-11-03 14:32:13 +00:00
|
|
|
getattribute("path:ray_length", RayLength);
|
2013-07-31 20:30:37 +00:00
|
|
|
|
2021-03-15 20:42:06 +01:00
|
|
|
int ray_depth = 0;
|
2013-07-31 20:30:37 +00:00
|
|
|
getattribute("path:ray_depth", ray_depth);
|
|
|
|
|
RayDepth = (float)ray_depth;
|
2014-04-21 14:20:29 +02:00
|
|
|
|
2021-03-15 20:42:06 +01:00
|
|
|
int diffuse_depth = 0;
|
2016-12-06 16:15:36 +01:00
|
|
|
getattribute("path:diffuse_depth", diffuse_depth);
|
|
|
|
|
DiffuseDepth = (float)diffuse_depth;
|
|
|
|
|
|
2021-03-15 20:42:06 +01:00
|
|
|
int glossy_depth = 0;
|
2016-12-06 16:15:36 +01:00
|
|
|
getattribute("path:glossy_depth", glossy_depth);
|
|
|
|
|
GlossyDepth = (float)glossy_depth;
|
|
|
|
|
|
2021-03-15 20:42:06 +01:00
|
|
|
int transparent_depth = 0;
|
2014-04-21 14:20:29 +02:00
|
|
|
getattribute("path:transparent_depth", transparent_depth);
|
|
|
|
|
TransparentDepth = (float)transparent_depth;
|
2016-01-06 23:38:13 +01:00
|
|
|
|
2021-03-15 20:42:06 +01:00
|
|
|
int transmission_depth = 0;
|
2016-01-06 23:38:13 +01:00
|
|
|
getattribute("path:transmission_depth", transmission_depth);
|
|
|
|
|
TransmissionDepth = (float)transmission_depth;
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|