Blender V5.3
eevee_lightprobe_shared.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
10
11#pragma once
12
14
16
17#ifndef GPU_SHADER
18namespace blender::eevee {
19#endif
20
21/* -------------------------------------------------------------------- */
24
29
34
35/* Sampling coordinates using UV space. */
37 /* Offset in UV space to the start of the sampling space of the octahedron map. */
39 /* Scaling of the squared UV space of the octahedron map. */
40 float scale;
41 /* Layer of the atlas where the octahedron map is stored. */
42 float layer;
43};
44
45/* Pixel read/write coordinates using pixel space. */
47 /* Offset in pixel space to the start of the writing space of the octahedron map.
48 * Note that the writing space is not the same as the sampling space as we have borders. */
50 /* Size of the area in pixel that is covered by this probe mip-map. */
51 int extent;
52 /* Layer of the atlas where the octahedron map is stored. */
53 int layer;
54};
55
78
86
87/* Used for sphere probe spherical harmonics extraction. Output one for each thread-group
88 * and do a sum afterward. Reduces bandwidth usage. */
95
101
103
104/* -------------------------------------------------------------------- */
107
125
134
136
137/* -------------------------------------------------------------------- */
140
154
156 /* Offset in pixel to the start of the data inside the atlas texture. */
158};
159
160#define IrradianceBrickPacked uint
161
163{
164 uint2 data = (uint2(brick.atlas_coord) & 0xFFFFu) << uint2(0u, 16u);
165 IrradianceBrickPacked brick_packed = data.x | data.y;
166 return brick_packed;
167}
168
170{
171 IrradianceBrick brick;
172 brick.atlas_coord = (uint2(brick_packed) >> uint2(0u, 16u)) & uint2(0xFFFFu);
173 return brick;
174}
175
177
178/* -------------------------------------------------------------------- */
181
183 /* Actually stores radiance and world (sky) visibility. Stored normalized. */
186 /* Accumulated weights per face. */
189 float _pad0;
190 float _pad1;
191};
192
223
273
282
284
285#ifndef GPU_SHADER
286} // namespace blender::eevee
287#endif
#define host_shared
int32_t bool32_t
#define IrradianceBrickPacked
static IrradianceBrickPacked irradiance_brick_pack(IrradianceBrick brick)
static IrradianceBrick irradiance_brick_unpack(IrradianceBrickPacked brick_packed)
VecBase< uint32_t, 2 > uint2
unsigned int uint
Definition BKE_text.h:55
MatBase< float, 4, 4 > float4x4
MatBase< float, 3, 4 > float3x4
VecBase< float, 4 > float4
unsigned int uint32_t
Definition BKE_text.h:81
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
BMesh const char void * data
struct ReflectionProbeLowFreqLight low_freq_light
struct SurfelRadiance radiance_direct
struct SurfelRadiance radiance_indirect[2]