Blender V5.3
gpu_shader_material_tex_environment.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
9
10[[node]]
12{
14 if (nco.x == 0.0f || nco.y == 0.0f) {
15 uv = float3(0.0f);
16 return;
17 }
18 uv.x = -atan(nco.y, nco.x) / (2.0f * M_PI) + 0.5f;
19 uv.y = atan(nco.z, hypot(nco.x, nco.y)) / M_PI + 0.5f;
20}
21
22[[node]]
24{
26 nco.y -= 1.0f;
27
28 float div = 2.0f * sqrt(max(-0.5f * nco.y, 0.0f));
29 nco /= max(1e-8f, div);
30
31 uv = 0.5f * nco.xzz + 0.5f;
32}
33
34[[node]]
36{
37 color = float4(1.0f, 0.0f, 1.0f, 1.0f);
38}
#define M_PI
btScalar max
#define atan
#define sqrt
void node_tex_environment_equirectangular(float3 co, float3 &uv)
void node_tex_environment_empty(float3, float4 &color)
void node_tex_environment_mirror_ball(float3 co, float3 &uv)
float3 vector_math_safe_normalize(float3 a)
float hypot(float x, float y)
float z
Definition sky_math.h:136
float y
Definition sky_math.h:136
float x
Definition sky_math.h:136