Blender V5.0
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
8
9#pragma once
10
12
14
15#ifndef GPU_SHADER
16namespace blender::eevee {
17#endif
18
19/* -------------------------------------------------------------------- */
22
28
29enum LightProbeShape : uint32_t {
32};
33
34/* Sampling coordinates using UV space. */
36 /* Offset in UV space to the start of the sampling space of the octahedron map. */
38 /* Scaling of the squared UV space of the octahedron map. */
39 float scale;
40 /* Layer of the atlas where the octahedron map is stored. */
41 float layer;
42};
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};
56
57
80
81
89
90/* Used for sphere probe spherical harmonics extraction. Output one for each thread-group
91 * and do a sum afterward. Reduces bandwidth usage. */
99
106
107
108
109/* -------------------------------------------------------------------- */
112
126
127
136
137
138
139/* -------------------------------------------------------------------- */
142
157
159 /* Offset in pixel to the start of the data inside the atlas texture. */
161};
162
163#define IrradianceBrickPacked uint
164
166{
167 uint2 data = (uint2(brick.atlas_coord) & 0xFFFFu) << uint2(0u, 16u);
168 IrradianceBrickPacked brick_packed = data.x | data.y;
169 return brick_packed;
170}
171
173{
174 IrradianceBrick brick;
175 brick.atlas_coord = (uint2(brick_packed) >> uint2(0u, 16u)) & uint2(0xFFFFu);
176 return brick;
177}
178
180
181/* -------------------------------------------------------------------- */
184
186 /* Actually stores radiance and world (sky) visibility. Stored normalized. */
189 /* Accumulated weights per face. */
192 float _pad0;
193 float _pad1;
194};
196
228
279
289
290
291
292#ifndef GPU_SHADER
293} // namespace blender::eevee
294#endif
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition BLI_assert.h:86
unsigned int uint
int32_t bool32_t
BMesh const char void * data
#define IrradianceBrickPacked
static IrradianceBrickPacked irradiance_brick_pack(IrradianceBrick brick)
static IrradianceBrick irradiance_brick_unpack(IrradianceBrickPacked brick_packed)
VecBase< uint32_t, 2 > uint2
MatBase< float, 4, 4 > float4x4
MatBase< float, 3, 4 > float3x4
VecBase< float, 4 > float4
VecBase< int32_t, 2 > int2
VecBase< float, 2 > float2
ReflectionProbeLowFreqLight low_freq_light