Blender  V2.93
DNA_lightprobe_types.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or
3  * modify it under the terms of the GNU General Public License
4  * as published by the Free Software Foundation; either version 2
5  * of the License, or (at your option) any later version.
6  *
7  * This program is distributed in the hope that it will be useful,
8  * but WITHOUT ANY WARRANTY; without even the implied warranty of
9  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  * GNU General Public License for more details.
11  *
12  * You should have received a copy of the GNU General Public License
13  * along with this program; if not, write to the Free Software Foundation,
14  * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15  */
16 
21 #pragma once
22 
23 #include "DNA_ID.h"
24 #include "DNA_defs.h"
25 #include "DNA_listBase.h"
26 
27 #include "BLI_assert.h"
28 
29 #ifdef __cplusplus
30 extern "C" {
31 #endif
32 
33 struct AnimData;
34 struct Object;
35 
36 typedef struct LightProbe {
37  ID id;
39  struct AnimData *adt;
40 
42  char type;
44  char flag;
49 
51  float distinf;
53  float distpar;
55  float falloff;
56 
57  float clipsta, clipend;
58 
61  float vis_blur;
62 
64  float intensity;
65 
70  char _pad1[4];
71 
75  struct Image *image;
78 
79  /* Runtime display data */
81  char _pad[8];
83 
84 /* Probe->type */
85 enum {
89 };
90 
91 /* Probe->flag */
92 enum {
99 };
100 
101 /* Probe->display */
102 enum {
107 };
108 
109 /* Probe->parallax && Probe->attenuation_type*/
110 enum {
113 };
114 
115 /* ------- Eevee LightProbes ------- */
116 /* Needs to be there because written to file with the light-cache. */
117 
118 /* IMPORTANT Padding in these structs is essential. It must match
119  * GLSL struct definition in lightprobe_lib.glsl. */
120 
121 /* Must match CubeData. */
122 typedef struct LightProbeCache {
126  float _pad3[2];
127  float attenuationmat[4][4];
128  float parallaxmat[4][4];
130 
131 /* Must match GridData. */
132 typedef struct LightGridCache {
133  float mat[4][4];
140  float increment_z[3], _pad4;
143 
144 /* These are used as UBO data. They need to be aligned to size of vec4. */
147 
148 /* ------ Eevee Lightcache ------- */
149 
150 typedef struct LightCacheTexture {
151  struct GPUTexture *tex;
153  char *data;
154  int tex_size[3];
155  char data_type;
157  char _pad[2];
159 
160 typedef struct LightCache {
161  int flag;
163  int version;
165  int type;
166  /* only a single cache for now */
170  int mips_len;
173  char _pad[4][2];
174  /* In the future, we could create a bigger texture containing
175  * multiple caches (for animation) and interpolate between the
176  * caches overtime to another texture. */
182  /* All lightprobes data contained in the cache. */
186 
187 /* Bump the version number for lightcache data structure changes. */
188 #define LIGHTCACHE_STATIC_VERSION 2
189 
190 /* LightCache->type */
191 enum {
193 };
194 
195 /* LightCache->flag */
196 enum {
197  LIGHTCACHE_BAKED = (1 << 0),
198  LIGHTCACHE_BAKING = (1 << 1),
201  /* Update tagging */
207  LIGHTCACHE_INVALID = (1 << 8),
210 };
211 
212 /* EEVEE_LightCacheTexture->data_type */
213 enum {
214  LIGHTCACHETEX_BYTE = (1 << 0),
216  LIGHTCACHETEX_UINT = (1 << 2),
217 };
218 
219 #ifdef __cplusplus
220 }
221 #endif
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition: BLI_assert.h:89
ID and Library types, which are fundamental for sdna.
@ 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_FLAG_SHOW_PARALLAX
@ LIGHTPROBE_FLAG_SHOW_CLIP_DIST
@ LIGHTPROBE_FLAG_SHOW_INFLUENCE
@ LIGHTPROBE_FLAG_INVERT_GROUP
@ LIGHTPROBE_FLAG_SHOW_DATA
@ LIGHTPROBE_FLAG_CUSTOM_PARALLAX
struct LightGridCache LightGridCache
struct LightProbeCache LightProbeCache
struct LightCacheTexture LightCacheTexture
struct LightCache LightCache
struct LightProbe LightProbe
@ LIGHTPROBE_DISP_SHADED
@ LIGHTPROBE_DISP_REFLECTIVE
@ LIGHTPROBE_DISP_WIRE
@ LIGHTPROBE_DISP_DIFFUSE
@ LIGHTCACHETEX_FLOAT
@ LIGHTCACHETEX_BYTE
@ LIGHTCACHETEX_UINT
@ LIGHTPROBE_TYPE_CUBE
@ LIGHTPROBE_TYPE_PLANAR
@ LIGHTPROBE_TYPE_GRID
@ LIGHTCACHE_TYPE_STATIC
These structs are the foundation for all linked lists in the library system.
struct GPUTexture GPUTexture
Definition: GPU_texture.h:33
Definition: DNA_ID.h:273
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