Blender V4.5
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
90
91/* Probe->type */
92enum {
96};
97
98/* Probe->flag */
99enum {
107};
108
109/* Probe->grid_flag */
110enum {
114};
115
116/* Probe->display */
117enum {
122};
123
124/* Probe->parallax && Probe->attenuation_type. */
125enum {
128};
129
130/* ------- Eevee LightProbes ------- */
131/* Needs to be there because written to file with the light-cache. */
132
133/* IMPORTANT Padding in these structs is essential. It must match
134 * GLSL struct definition in lightprobe_lib.glsl. */
135
136/* Must match CubeData. */
145
146/* Must match GridData. */
158
159/* These are used as UBO data. They need to be aligned to size of vec4. */
162
163/* ------ Eevee Lightcache ------- */
164
166 struct GPUTexture *tex;
168 char *data;
169 int tex_size[3];
172 char _pad[2];
174
175typedef struct LightCache {
176 int flag;
180 int type;
181 /* only a single cache for now */
188 char _pad[4][2];
189 /* In the future, we could create a bigger texture containing
190 * multiple caches (for animation) and interpolate between the
191 * caches overtime to another texture. */
197 /* All light-probes data contained in the cache. */
201
202/* Bump the version number for lightcache data structure changes. */
203#define LIGHTCACHE_STATIC_VERSION 2
204
205/* LightCache->type */
206enum {
208};
209
210/* LightCache->flag */
211enum {
216 /* Update tagging */
225};
226
227/* EEVEE_LightCacheTexture->data_type */
228enum {
232};
233
234/* -------------------------------------------------------------------- */
241
246typedef struct LightProbeBakingData {
247 float (*L0)[4];
248 float (*L1_a)[4];
249 float (*L1_b)[4];
250 float (*L1_c)[4];
251 float *validity;
252 /* Capture offset. Only for debugging. */
253 float (*virtual_offset)[4];
255
260 float (*L0)[3];
261 float (*L1_a)[3];
262 float (*L1_b)[3];
263 float (*L1_c)[3];
265
275
283
288typedef struct LightProbeBlockData {
289 /* Offset inside the level-of-detail this block starts. */
290 int offset[3];
291 /* Level-of-detail this block is from. */
292 int level;
294
296
297/* -------------------------------------------------------------------- */
301
332
334enum {
339};
340
357
359enum {
364};
365
#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
@ 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_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
@ LIGHTPROBE_TYPE_PLANE
@ LIGHTPROBE_TYPE_VOLUME
@ LIGHTPROBE_TYPE_SPHERE
@ LIGHTPROBE_SHAPE_BOX
@ LIGHTPROBE_SHAPE_ELIPSOID
@ LIGHTPROBE_CACHE_UNIFORM_GRID
@ LIGHTPROBE_CACHE_ADAPTIVE_RESOLUTION
@ LIGHTCACHE_TYPE_STATIC
@ LIGHTCACHETEX_FLOAT
@ LIGHTCACHETEX_BYTE
@ LIGHTCACHETEX_UINT
These structs are the foundation for all linked lists in the library system.
#define typedef
Definition DNA_ID.h:404
struct GPUTexture * tex
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