Blender V4.3
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
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
85
86/* Probe->type */
87enum {
91};
92
93/* Probe->flag */
94enum {
101};
102
103/* Probe->grid_flag */
104enum {
108};
109
110/* Probe->display */
111enum {
116};
117
118/* Probe->parallax && Probe->attenuation_type. */
119enum {
122};
123
124/* ------- Eevee LightProbes ------- */
125/* Needs to be there because written to file with the light-cache. */
126
127/* IMPORTANT Padding in these structs is essential. It must match
128 * GLSL struct definition in lightprobe_lib.glsl. */
129
130/* Must match CubeData. */
131typedef struct LightProbeCache {
132 float position[3], parallax_type;
135 float _pad3[2];
136 float attenuationmat[4][4];
137 float parallaxmat[4][4];
139
140/* Must match GridData. */
152
153/* These are used as UBO data. They need to be aligned to size of vec4. */
156
157/* ------ Eevee Lightcache ------- */
158
159typedef struct LightCacheTexture {
160 struct GPUTexture *tex;
162 char *data;
163 int tex_size[3];
166 char _pad[2];
168
169typedef struct LightCache {
170 int flag;
174 int type;
175 /* only a single cache for now */
182 char _pad[4][2];
183 /* In the future, we could create a bigger texture containing
184 * multiple caches (for animation) and interpolate between the
185 * caches overtime to another texture. */
191 /* All light-probes data contained in the cache. */
195
196/* Bump the version number for lightcache data structure changes. */
197#define LIGHTCACHE_STATIC_VERSION 2
198
199/* LightCache->type */
200enum {
202};
203
204/* LightCache->flag */
205enum {
210 /* Update tagging */
219};
220
221/* EEVEE_LightCacheTexture->data_type */
222enum {
226};
227
228/* -------------------------------------------------------------------- */
240typedef struct LightProbeBakingData {
241 float (*L0)[4];
242 float (*L1_a)[4];
243 float (*L1_b)[4];
244 float (*L1_c)[4];
245 float *validity;
246 /* Capture offset. Only for debugging. */
249
259
269
277
282typedef struct LightProbeBlockData {
283 /* Offset inside the level-of-detail this block starts. */
284 int offset[3];
285 /* Level-of-detail this block is from. */
286 int level;
288
291/* -------------------------------------------------------------------- */
326
328enum {
333};
334
351
353enum {
358};
359
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition BLI_assert.h:90
ID and Library types, which are fundamental for SDNA.
struct LightProbeObjectCache LightProbeObjectCache
@ LIGHTCACHETEX_FLOAT
@ LIGHTCACHETEX_BYTE
@ LIGHTCACHETEX_UINT
@ LIGHTPROBE_CACHE_UNIFORM_GRID
@ LIGHTPROBE_CACHE_ADAPTIVE_RESOLUTION
struct LightProbeBakingData LightProbeBakingData
struct LightProbeIrradianceData LightProbeIrradianceData
@ 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_CACHE_TYPE_NONE
@ LIGHTPROBE_CACHE_TYPE_STATIC
@ LIGHTPROBE_GRID_CAPTURE_EMISSION
@ LIGHTPROBE_GRID_CAPTURE_WORLD
@ LIGHTPROBE_GRID_CAPTURE_INDIRECT
struct LightProbeGridCacheFrame LightProbeGridCacheFrame
struct LightGridCache LightGridCache
@ LIGHTCACHE_TYPE_STATIC
struct LightProbeConnectivityData LightProbeConnectivityData
struct LightProbeCache LightProbeCache
struct LightCacheTexture LightCacheTexture
struct LightCache LightCache
struct LightProbe LightProbe
@ LIGHTPROBE_SHAPE_BOX
@ LIGHTPROBE_SHAPE_ELIPSOID
struct LightProbeBlockData LightProbeBlockData
@ LIGHTPROBE_DISP_SHADED
@ LIGHTPROBE_DISP_REFLECTIVE
@ LIGHTPROBE_DISP_WIRE
@ LIGHTPROBE_DISP_DIFFUSE
struct LightProbeVisibilityData LightProbeVisibilityData
@ LIGHTPROBE_FLAG_SHOW_PARALLAX
@ LIGHTPROBE_FLAG_SHOW_CLIP_DIST
@ LIGHTPROBE_FLAG_SHOW_INFLUENCE
@ LIGHTPROBE_FLAG_INVERT_GROUP
@ LIGHTPROBE_FLAG_SHOW_DATA
@ LIGHTPROBE_FLAG_CUSTOM_PARALLAX
@ LIGHTPROBE_TYPE_PLANE
@ LIGHTPROBE_TYPE_VOLUME
@ LIGHTPROBE_TYPE_SPHERE
These structs are the foundation for all linked lists in the library system.
draw_view in_light_buf[] float
unsigned char uint8_t
Definition stdint.h:78
Definition DNA_ID.h:413
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