Blender V5.3
gpu_shader_material_object_info.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]]
10void node_object_info(float mat_index,
12 ShadingData &sd,
13 float3 &location,
14 float4 &color,
15 float &alpha,
16 float &object_index,
17 float &material_index,
18 float &random)
19{
20 location = kg.object_matrices_get(sd).model[3].xyz;
21 ObjectInfos info = kg.object_infos_get(sd);
22 color = info.ob_color;
23 alpha = info.ob_color.a;
24 object_index = info.index;
25 /* TODO(fclem): Put that inside the Material UBO. */
26 material_index = mat_index;
27 random = info.random;
28}
#define resource_table
void node_object_info(float mat_index, KernelGlobals &kg, ShadingData &sd, float3 &location, float4 &color, float &alpha, float &object_index, float &material_index, float &random)