Blender V5.3
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
8
9[[node]]
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}
#define resource_table
VecBase< float, D > normalize(VecOp< float, D >) RET
#define abs
float length(VecOp< float, D >) RET
void camera(KernelGlobals &kg, const ShadingData &sd, float3 &outview, float &outdepth, float &outdist)
void point_transform_world_to_view(float3 vin, KernelGlobals &kg, const ShadingData &sd, float3 &vout)
float z
Definition sky_math.h:136