Blender V5.3
gpu_shader_material_light_path.bsl.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2019-2022 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
5#pragma once
6
8
9[[node]]
11 float &is_camera_ray,
12 float &is_shadow_ray,
13 float &is_diffuse_ray,
14 float &is_glossy_ray,
15 float &is_singular_ray,
16 float &is_reflection_ray,
17 float &is_transmission_ray,
18 float &is_volume_scatter_ray,
19 float &ray_length,
20 float &ray_depth,
21 float &diffuse_depth,
22 float &glossy_depth,
23 float &transparent_depth,
24 float &transmission_depth,
25 float &path_depth)
26{
27 /* TODO(fclem): EEVEE implementation leaking. */
28 /* Supported. */
29 is_camera_ray = float(sd.ray_type == RAY_TYPE_CAMERA);
30 is_shadow_ray = float(sd.ray_type == RAY_TYPE_SHADOW);
31 is_diffuse_ray = float(sd.ray_type == RAY_TYPE_DIFFUSE);
32 is_glossy_ray = float(sd.ray_type == RAY_TYPE_GLOSSY);
33 /* Kind of supported. */
34 is_singular_ray = is_glossy_ray;
35 is_reflection_ray = is_glossy_ray;
36 is_transmission_ray = is_glossy_ray;
37 ray_depth = sd.ray_depth;
38 diffuse_depth = (is_diffuse_ray == 1.0f) ? sd.ray_depth : 0.0f;
39 glossy_depth = (is_glossy_ray == 1.0f) ? sd.ray_depth : 0.0f;
40 transmission_depth = (is_transmission_ray == 1.0f) ? glossy_depth : 0.0f;
41 ray_length = sd.ray_length;
42 /* Not supported. */
43 transparent_depth = 0.0f;
44 is_volume_scatter_ray = 0.0f;
45 path_depth = 0.0f;
46}
void node_light_path(const ShadingData &sd, float &is_camera_ray, float &is_shadow_ray, float &is_diffuse_ray, float &is_glossy_ray, float &is_singular_ray, float &is_reflection_ray, float &is_transmission_ray, float &is_volume_scatter_ray, float &ray_length, float &ray_depth, float &diffuse_depth, float &glossy_depth, float &transparent_depth, float &transmission_depth, float &path_depth)
KERNEL_FEATURE_LIGHT_PASSES KERNEL_FEATURE_PATH_GUIDING float