Blender V5.3
gpu_shader_material_tangent.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 tangent_orco_x(float3 orco_in, float3 &orco_out)
11{
12 orco_out = orco_in.xzy * float3(0.0f, -0.5f, 0.5f) + float3(0.0f, 0.25f, -0.25f);
13}
14
15[[node]]
16void tangent_orco_y(float3 orco_in, float3 &orco_out)
17{
18 orco_out = orco_in.zyx * float3(-0.5f, 0.0f, 0.5f) + float3(0.25f, 0.0f, -0.25f);
19}
20
21[[node]]
22void tangent_orco_z(float3 orco_in, float3 &orco_out)
23{
24 orco_out = orco_in.yxz * float3(-0.5f, 0.5f, 0.0f) + float3(0.25f, -0.25f, 0.0f);
25}
26
27[[node]]
28void node_tangentmap(float4 attr_tangent, float3 &tangent)
29{
30 tangent = normalize(attr_tangent.xyz);
31}
32
33[[node]]
35{
37 T = cross(sd.N, normalize(cross(T, sd.N)));
38}
#define resource_table
VecBase< float, D > normalize(VecOp< float, D >) RET
VecBase< float, 3 > cross(VecOp< float, 3 >, VecOp< float, 3 >) RET
void tangent_orco_y(float3 orco_in, float3 &orco_out)
void tangent_orco_z(float3 orco_in, float3 &orco_out)
void node_tangent(float3 orco, KernelGlobals &kg, ShadingData &sd, float3 &T)
void tangent_orco_x(float3 orco_in, float3 &orco_out)
void node_tangentmap(float4 attr_tangent, float3 &tangent)
void direction_transform_object_to_world(float3 vin, KernelGlobals &kg, const ShadingData &sd, float3 &vout)
#define T