2011-04-27 11:58:34 +00:00
|
|
|
/*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Copyright 2011-2013 Blender Foundation
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
* you may not use this file except in compliance with the License.
|
|
|
|
* You may obtain a copy of the License at
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-04-27 11:58:34 +00:00
|
|
|
*
|
2013-08-18 14:16:15 +00:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
* See the License for the specific language governing permissions and
|
|
|
|
* limitations under the License
|
2011-04-27 11:58:34 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#include "stdosl.h"
|
|
|
|
|
|
|
|
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-07-31 20:30:37 +00:00
|
|
|
output float RayLength = 0.0,
|
|
|
|
output float RayDepth = 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");
|
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
|
|
|
|
|
|
|
int ray_depth;
|
|
|
|
getattribute("path:ray_depth", ray_depth);
|
|
|
|
RayDepth = (float)ray_depth;
|
2011-04-27 11:58:34 +00:00
|
|
|
}
|
|
|
|
|