Blender
V5.3
source
blender
gpu
shaders
material
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
7
#include "
gpu_shader_material_interface.bsl.hh
"
8
9
[[
node
]]
10
void
node_object_info
(
float
mat_index,
11
[[
resource_table
]]
KernelGlobals
&kg,
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
}
resource_table
#define resource_table
Definition
gpu_shader_cxx_attribute.hh:128
node
#define node
Definition
gpu_shader_cxx_attribute.hh:142
gpu_shader_material_interface.bsl.hh
node_object_info
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)
Definition
gpu_shader_material_object_info.bsl.hh:10
random
Definition
eevee_sampling_lib.bsl.hh:85
KernelGlobals
Definition
eevee_nodetree_lib.bsl.hh:141
ObjectInfos
Definition
draw_shader_shared.hh:469
ObjectInfos::index
uint index
Definition
draw_shader_shared.hh:477
ObjectInfos::random
float random
Definition
draw_shader_shared.hh:480
ObjectInfos::ob_color
float4 ob_color
Definition
draw_shader_shared.hh:476
ShadingData
Definition
eevee_nodetree_lib.bsl.hh:56
float3
Definition
sky_math.h:135
float4
Definition
sky_math.h:224
Generated on
for Blender by
doxygen
1.18.0