Blender V5.0
DNA_lightprobe_types.h
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
11#include "DNA_ID.h"
12#include "DNA_defs.h"
13#include "DNA_listBase.h"
14
15#include "BLI_assert.h"
16
17struct AnimData;
18struct Object;
19#ifdef __cplusplus
20namespace blender::gpu {
21class Texture;
22} // namespace blender::gpu
24#else
25typedef struct GPUTexture GPUTexture;
26#endif
27
98
99/* Probe->type */
100enum {
104};
105
106/* Probe->flag */
107enum {
115};
116
117/* Probe->grid_flag */
118enum {
122};
123
124/* Probe->display */
125enum {
130};
131
132/* Probe->parallax && Probe->attenuation_type. */
133enum {
136};
137
138/* ------- Eevee LightProbes ------- */
139/* Needs to be there because written to file with the light-cache. */
140
141/* IMPORTANT Padding in these structs is essential. It must match
142 * GLSL struct definition in lightprobe_lib.glsl. */
143
144/* Must match CubeData. */
153
154/* Must match GridData. */
166
167/* These are used as UBO data. They need to be aligned to size of vec4. */
170
171/* ------ Eevee Lightcache ------- */
172
182
183typedef struct LightCache {
184 int flag;
188 int type;
189 /* only a single cache for now */
196 char _pad[4][2];
197 /* In the future, we could create a bigger texture containing
198 * multiple caches (for animation) and interpolate between the
199 * caches overtime to another texture. */
205 /* All light-probes data contained in the cache. */
209
210/* Bump the version number for lightcache data structure changes. */
211#define LIGHTCACHE_STATIC_VERSION 2
212
213/* LightCache->type */
214enum {
216};
217
218/* LightCache->flag */
219enum {
224 /* Update tagging */
233};
234
235/* EEVEE_LightCacheTexture->data_type */
236enum {
240};
241
242/* -------------------------------------------------------------------- */
249
254typedef struct LightProbeBakingData {
255 float (*L0)[4];
256 float (*L1_a)[4];
257 float (*L1_b)[4];
258 float (*L1_c)[4];
259 float *validity;
260 /* Capture offset. Only for debugging. */
263
273
283
291
296typedef struct LightProbeBlockData {
297 /* Offset inside the level-of-detail this block starts. */
298 int offset[3];
299 /* Level-of-detail this block is from. */
300 int level;
302
304
305/* -------------------------------------------------------------------- */
309
340
342enum {
347};
348
365
367enum {
372};
373
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition BLI_assert.h:86
ID and Library types, which are fundamental for SDNA.
ID_Type
@ ID_LP
struct GPUTexture GPUTexture
@ LIGHTPROBE_CACHE_UNIFORM_GRID
@ LIGHTPROBE_CACHE_ADAPTIVE_RESOLUTION
@ LIGHTPROBE_GRID_CAPTURE_EMISSION
@ LIGHTPROBE_GRID_CAPTURE_WORLD
@ LIGHTPROBE_GRID_CAPTURE_INDIRECT
@ LIGHTPROBE_DISP_SHADED
@ LIGHTPROBE_DISP_REFLECTIVE
@ LIGHTPROBE_DISP_WIRE
@ LIGHTPROBE_DISP_DIFFUSE
@ LIGHTPROBE_FLAG_SHOW_PARALLAX
@ LIGHTPROBE_FLAG_SHOW_CLIP_DIST
@ LIGHTPROBE_FLAG_SHOW_INFLUENCE
@ LIGHTPROBE_DS_EXPAND
@ LIGHTPROBE_FLAG_INVERT_GROUP
@ LIGHTPROBE_FLAG_SHOW_DATA
@ LIGHTPROBE_FLAG_CUSTOM_PARALLAX
@ LIGHTPROBE_CACHE_TYPE_NONE
@ LIGHTPROBE_CACHE_TYPE_STATIC
@ LIGHTCACHE_TYPE_STATIC
@ LIGHTPROBE_SHAPE_BOX
@ LIGHTPROBE_SHAPE_ELIPSOID
@ LIGHTCACHE_UPDATE_WORLD
@ LIGHTCACHE_BAKING
@ LIGHTCACHE_BAKED
@ LIGHTCACHE_GRID_READY
@ LIGHTCACHE_UPDATE_AUTO
@ LIGHTCACHE_NOT_USABLE
@ LIGHTCACHE_UPDATE_GRID
@ LIGHTCACHE_CUBE_READY
@ LIGHTCACHE_INVALID
@ LIGHTCACHE_UPDATE_CUBE
@ LIGHTPROBE_TYPE_PLANE
@ LIGHTPROBE_TYPE_VOLUME
@ LIGHTPROBE_TYPE_SPHERE
@ LIGHTCACHETEX_FLOAT
@ LIGHTCACHETEX_BYTE
@ LIGHTCACHETEX_UINT
These structs are the foundation for all linked lists in the library system.
nullptr float
#define typedef
Definition DNA_ID.h:414
LightGridCache * grid_data
LightProbeCache * cube_data
LightCacheTexture grid_tx
LightCacheTexture * cube_mips
LightCacheTexture cube_tx
LightProbeVisibilityData visibility
LightProbeConnectivityData connectivity
LightProbeBlockData * block_infos
LightProbeIrradianceData irradiance
struct LightProbeGridCacheFrame * grid_static_cache
struct AnimData * adt
float grid_dilation_threshold
struct Collection * visibility_grp
float grid_validity_threshold