Blender  V3.3
DNA_lightprobe_types.h
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2 
7 #pragma once
8 
9 #include "DNA_ID.h"
10 #include "DNA_defs.h"
11 #include "DNA_listBase.h"
12 
13 #include "BLI_assert.h"
14 
15 #ifdef __cplusplus
16 extern "C" {
17 #endif
18 
19 struct AnimData;
20 struct Object;
21 
22 typedef struct LightProbe {
23  ID id;
25  struct AnimData *adt;
26 
28  char type;
30  char flag;
35 
37  float distinf;
39  float distpar;
41  float falloff;
42 
43  float clipsta, clipend;
44 
47  float vis_blur;
48 
50  float intensity;
51 
56  char _pad1[4];
57 
61  struct Image *image;
64 
65  /* Runtime display data */
67  char _pad[8];
69 
70 /* Probe->type */
71 enum {
75 };
76 
77 /* Probe->flag */
78 enum {
85 };
86 
87 /* Probe->display */
88 enum {
93 };
94 
95 /* Probe->parallax && Probe->attenuation_type. */
96 enum {
99 };
100 
101 /* ------- Eevee LightProbes ------- */
102 /* Needs to be there because written to file with the light-cache. */
103 
104 /* IMPORTANT Padding in these structs is essential. It must match
105  * GLSL struct definition in lightprobe_lib.glsl. */
106 
107 /* Must match CubeData. */
108 typedef struct LightProbeCache {
112  float _pad3[2];
113  float attenuationmat[4][4];
114  float parallaxmat[4][4];
116 
117 /* Must match GridData. */
118 typedef struct LightGridCache {
119  float mat[4][4];
126  float increment_z[3], _pad4;
129 
130 /* These are used as UBO data. They need to be aligned to size of vec4. */
133 
134 /* ------ Eevee Lightcache ------- */
135 
136 typedef struct LightCacheTexture {
137  struct GPUTexture *tex;
139  char *data;
140  int tex_size[3];
141  char data_type;
143  char _pad[2];
145 
146 typedef struct LightCache {
147  int flag;
149  int version;
151  int type;
152  /* only a single cache for now */
156  int mips_len;
159  char _pad[4][2];
160  /* In the future, we could create a bigger texture containing
161  * multiple caches (for animation) and interpolate between the
162  * caches overtime to another texture. */
168  /* All lightprobes data contained in the cache. */
172 
173 /* Bump the version number for lightcache data structure changes. */
174 #define LIGHTCACHE_STATIC_VERSION 2
175 
176 /* LightCache->type */
177 enum {
179 };
180 
181 /* LightCache->flag */
182 enum {
183  LIGHTCACHE_BAKED = (1 << 0),
184  LIGHTCACHE_BAKING = (1 << 1),
187  /* Update tagging */
193  LIGHTCACHE_INVALID = (1 << 8),
196 };
197 
198 /* EEVEE_LightCacheTexture->data_type */
199 enum {
200  LIGHTCACHETEX_BYTE = (1 << 0),
202  LIGHTCACHETEX_UINT = (1 << 2),
203 };
204 
205 #ifdef __cplusplus
206 }
207 #endif
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition: BLI_assert.h:86
ID and Library types, which are fundamental for sdna.
@ LIGHTPROBE_DISP_SHADED
@ LIGHTPROBE_DISP_REFLECTIVE
@ LIGHTPROBE_DISP_WIRE
@ LIGHTPROBE_DISP_DIFFUSE
@ LIGHTCACHETEX_FLOAT
@ LIGHTCACHETEX_BYTE
@ LIGHTCACHETEX_UINT
@ LIGHTPROBE_SHAPE_BOX
@ LIGHTPROBE_SHAPE_ELIPSOID
struct LightGridCache LightGridCache
struct LightProbeCache LightProbeCache
struct LightCacheTexture LightCacheTexture
struct LightCache LightCache
struct LightProbe LightProbe
@ 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_CUBE
@ LIGHTPROBE_TYPE_PLANAR
@ LIGHTPROBE_TYPE_GRID
@ LIGHTCACHE_TYPE_STATIC
@ 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
These structs are the foundation for all linked lists in the library system.
struct GPUTexture GPUTexture
Definition: GPU_texture.h:17
Definition: DNA_ID.h:368
struct GPUTexture * tex
LightGridCache * grid_data
LightProbeCache * cube_data
LightCacheTexture grid_tx
LightCacheTexture * cube_mips
LightCacheTexture cube_tx
float attenuationmat[4][4]
struct AnimData * adt
struct Object * parallax_ob
struct Collection * visibility_grp
struct Image * image