Blender
V5.3
source
blender
gpu
shaders
material
gpu_shader_material_camera.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_transform_utils.bsl.hh
"
8
9
[[
node
]]
10
void
camera
([[
resource_table
]]
KernelGlobals
&kg,
11
const
ShadingData
&sd,
12
float3
&outview,
13
float
&outdepth,
14
float
&outdist)
15
{
16
float3
vP;
17
point_transform_world_to_view
(sd.
P
, kg, sd, vP);
18
vP.
z
= -vP.
z
;
19
outdepth =
abs
(vP.
z
);
20
outdist =
length
(vP);
21
outview =
normalize
(vP);
22
}
resource_table
#define resource_table
Definition
gpu_shader_cxx_attribute.hh:128
node
#define node
Definition
gpu_shader_cxx_attribute.hh:142
normalize
VecBase< float, D > normalize(VecOp< float, D >) RET
abs
#define abs
Definition
gpu_shader_cxx_builtin.hh:104
length
float length(VecOp< float, D >) RET
camera
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
Definition
gpu_shader_material_camera.bsl.hh:10
gpu_shader_material_transform_utils.bsl.hh
point_transform_world_to_view
void point_transform_world_to_view(float3 vin, KernelGlobals &kg, const ShadingData &sd, float3 &vout)
Definition
gpu_shader_material_transform_utils.bsl.hh:286
KernelGlobals
Definition
eevee_nodetree_lib.bsl.hh:141
ShadingData
Definition
eevee_nodetree_lib.bsl.hh:56
ShadingData::P
packed_float3 P
Definition
eevee_nodetree_lib.bsl.hh:60
float3
Definition
sky_math.h:135
float3::z
float z
Definition
sky_math.h:136
Generated on
for Blender by
doxygen
1.18.0