Blender
V2.93
source
blender
makesdna
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
;
46
char
attenuation_type
;
48
char
parallax_type
;
49
51
float
distinf
;
53
float
distpar
;
55
float
falloff
;
56
57
float
clipsta
,
clipend
;
58
60
float
vis_bias
,
vis_bleedbias
;
61
float
vis_blur
;
62
64
float
intensity
;
65
67
int
grid_resolution_x
;
68
int
grid_resolution_y
;
69
int
grid_resolution_z
;
70
char
_pad1
[4];
71
73
struct
Object
*
parallax_ob
;
75
struct
Image
*
image
;
77
struct
Collection
*
visibility_grp
;
78
79
/* Runtime display data */
80
float
distfalloff
,
distgridinf
;
81
char
_pad
[8];
82
}
LightProbe
;
83
84
/* Probe->type */
85
enum
{
86
LIGHTPROBE_TYPE_CUBE
= 0,
87
LIGHTPROBE_TYPE_PLANAR
= 1,
88
LIGHTPROBE_TYPE_GRID
= 2,
89
};
90
91
/* Probe->flag */
92
enum
{
93
LIGHTPROBE_FLAG_CUSTOM_PARALLAX
= (1 << 0),
94
LIGHTPROBE_FLAG_SHOW_INFLUENCE
= (1 << 1),
95
LIGHTPROBE_FLAG_SHOW_PARALLAX
= (1 << 2),
96
LIGHTPROBE_FLAG_SHOW_CLIP_DIST
= (1 << 3),
97
LIGHTPROBE_FLAG_SHOW_DATA
= (1 << 4),
98
LIGHTPROBE_FLAG_INVERT_GROUP
= (1 << 5),
99
};
100
101
/* Probe->display */
102
enum
{
103
LIGHTPROBE_DISP_WIRE
= 0,
104
LIGHTPROBE_DISP_SHADED
= 1,
105
LIGHTPROBE_DISP_DIFFUSE
= 2,
106
LIGHTPROBE_DISP_REFLECTIVE
= 3,
107
};
108
109
/* Probe->parallax && Probe->attenuation_type*/
110
enum
{
111
LIGHTPROBE_SHAPE_ELIPSOID
= 0,
112
LIGHTPROBE_SHAPE_BOX
= 1,
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
{
123
float
position
[3],
parallax_type
;
124
float
attenuation_fac
;
125
float
attenuation_type
;
126
float
_pad3
[2];
127
float
attenuationmat
[4][4];
128
float
parallaxmat
[4][4];
129
}
LightProbeCache
;
130
131
/* Must match GridData. */
132
typedef
struct
LightGridCache
{
133
float
mat
[4][4];
135
int
resolution
[3],
offset
;
136
float
corner
[3],
attenuation_scale
;
138
float
increment_x
[3],
attenuation_bias
;
139
float
increment_y
[3],
level_bias
;
140
float
increment_z
[3],
_pad4
;
141
float
visibility_bias
,
visibility_bleed
,
visibility_range
,
_pad5
;
142
}
LightGridCache
;
143
144
/* These are used as UBO data. They need to be aligned to size of vec4. */
145
BLI_STATIC_ASSERT_ALIGN
(
LightProbeCache
, 16)
146
BLI_STATIC_ASSERT_ALIGN
(
LightGridCache
, 16)
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
;
156
char
components
;
157
char
_pad[2];
158
}
LightCacheTexture
;
159
160
typedef
struct
LightCache
{
161
int
flag
;
163
int
version
;
165
int
type
;
166
/* only a single cache for now */
168
int
cube_len
,
grid_len
;
170
int
mips_len
;
172
int
vis_res
,
ref_res
;
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. */
177
LightCacheTexture
grid_tx
;
179
LightCacheTexture
cube_tx
;
181
LightCacheTexture
*
cube_mips
;
182
/* All lightprobes data contained in the cache. */
183
LightProbeCache
*
cube_data
;
184
LightGridCache
*
grid_data
;
185
}
LightCache
;
186
187
/* Bump the version number for lightcache data structure changes. */
188
#define LIGHTCACHE_STATIC_VERSION 2
189
190
/* LightCache->type */
191
enum
{
192
LIGHTCACHE_TYPE_STATIC
= 0,
193
};
194
195
/* LightCache->flag */
196
enum
{
197
LIGHTCACHE_BAKED
= (1 << 0),
198
LIGHTCACHE_BAKING
= (1 << 1),
199
LIGHTCACHE_CUBE_READY
= (1 << 2),
200
LIGHTCACHE_GRID_READY
= (1 << 3),
201
/* Update tagging */
202
LIGHTCACHE_UPDATE_CUBE
= (1 << 4),
203
LIGHTCACHE_UPDATE_GRID
= (1 << 5),
204
LIGHTCACHE_UPDATE_WORLD
= (1 << 6),
205
LIGHTCACHE_UPDATE_AUTO
= (1 << 7),
207
LIGHTCACHE_INVALID
= (1 << 8),
209
LIGHTCACHE_NOT_USABLE
= (1 << 9),
210
};
211
212
/* EEVEE_LightCacheTexture->data_type */
213
enum
{
214
LIGHTCACHETEX_BYTE
= (1 << 0),
215
LIGHTCACHETEX_FLOAT
= (1 << 1),
216
LIGHTCACHETEX_UINT
= (1 << 2),
217
};
218
219
#ifdef __cplusplus
220
}
221
#endif
BLI_assert.h
BLI_STATIC_ASSERT_ALIGN
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition:
BLI_assert.h:89
DNA_ID.h
ID and Library types, which are fundamental for sdna.
DNA_defs.h
LIGHTPROBE_SHAPE_BOX
@ LIGHTPROBE_SHAPE_BOX
Definition:
DNA_lightprobe_types.h:112
LIGHTPROBE_SHAPE_ELIPSOID
@ LIGHTPROBE_SHAPE_ELIPSOID
Definition:
DNA_lightprobe_types.h:111
LIGHTCACHE_UPDATE_WORLD
@ LIGHTCACHE_UPDATE_WORLD
Definition:
DNA_lightprobe_types.h:204
LIGHTCACHE_BAKING
@ LIGHTCACHE_BAKING
Definition:
DNA_lightprobe_types.h:198
LIGHTCACHE_BAKED
@ LIGHTCACHE_BAKED
Definition:
DNA_lightprobe_types.h:197
LIGHTCACHE_GRID_READY
@ LIGHTCACHE_GRID_READY
Definition:
DNA_lightprobe_types.h:200
LIGHTCACHE_UPDATE_AUTO
@ LIGHTCACHE_UPDATE_AUTO
Definition:
DNA_lightprobe_types.h:205
LIGHTCACHE_NOT_USABLE
@ LIGHTCACHE_NOT_USABLE
Definition:
DNA_lightprobe_types.h:209
LIGHTCACHE_UPDATE_GRID
@ LIGHTCACHE_UPDATE_GRID
Definition:
DNA_lightprobe_types.h:203
LIGHTCACHE_CUBE_READY
@ LIGHTCACHE_CUBE_READY
Definition:
DNA_lightprobe_types.h:199
LIGHTCACHE_INVALID
@ LIGHTCACHE_INVALID
Definition:
DNA_lightprobe_types.h:207
LIGHTCACHE_UPDATE_CUBE
@ LIGHTCACHE_UPDATE_CUBE
Definition:
DNA_lightprobe_types.h:202
LIGHTPROBE_FLAG_SHOW_PARALLAX
@ LIGHTPROBE_FLAG_SHOW_PARALLAX
Definition:
DNA_lightprobe_types.h:95
LIGHTPROBE_FLAG_SHOW_CLIP_DIST
@ LIGHTPROBE_FLAG_SHOW_CLIP_DIST
Definition:
DNA_lightprobe_types.h:96
LIGHTPROBE_FLAG_SHOW_INFLUENCE
@ LIGHTPROBE_FLAG_SHOW_INFLUENCE
Definition:
DNA_lightprobe_types.h:94
LIGHTPROBE_FLAG_INVERT_GROUP
@ LIGHTPROBE_FLAG_INVERT_GROUP
Definition:
DNA_lightprobe_types.h:98
LIGHTPROBE_FLAG_SHOW_DATA
@ LIGHTPROBE_FLAG_SHOW_DATA
Definition:
DNA_lightprobe_types.h:97
LIGHTPROBE_FLAG_CUSTOM_PARALLAX
@ LIGHTPROBE_FLAG_CUSTOM_PARALLAX
Definition:
DNA_lightprobe_types.h:93
LightGridCache
struct LightGridCache LightGridCache
LightProbeCache
struct LightProbeCache LightProbeCache
LightCacheTexture
struct LightCacheTexture LightCacheTexture
LightCache
struct LightCache LightCache
LightProbe
struct LightProbe LightProbe
LIGHTPROBE_DISP_SHADED
@ LIGHTPROBE_DISP_SHADED
Definition:
DNA_lightprobe_types.h:104
LIGHTPROBE_DISP_REFLECTIVE
@ LIGHTPROBE_DISP_REFLECTIVE
Definition:
DNA_lightprobe_types.h:106
LIGHTPROBE_DISP_WIRE
@ LIGHTPROBE_DISP_WIRE
Definition:
DNA_lightprobe_types.h:103
LIGHTPROBE_DISP_DIFFUSE
@ LIGHTPROBE_DISP_DIFFUSE
Definition:
DNA_lightprobe_types.h:105
LIGHTCACHETEX_FLOAT
@ LIGHTCACHETEX_FLOAT
Definition:
DNA_lightprobe_types.h:215
LIGHTCACHETEX_BYTE
@ LIGHTCACHETEX_BYTE
Definition:
DNA_lightprobe_types.h:214
LIGHTCACHETEX_UINT
@ LIGHTCACHETEX_UINT
Definition:
DNA_lightprobe_types.h:216
LIGHTPROBE_TYPE_CUBE
@ LIGHTPROBE_TYPE_CUBE
Definition:
DNA_lightprobe_types.h:86
LIGHTPROBE_TYPE_PLANAR
@ LIGHTPROBE_TYPE_PLANAR
Definition:
DNA_lightprobe_types.h:87
LIGHTPROBE_TYPE_GRID
@ LIGHTPROBE_TYPE_GRID
Definition:
DNA_lightprobe_types.h:88
LIGHTCACHE_TYPE_STATIC
@ LIGHTCACHE_TYPE_STATIC
Definition:
DNA_lightprobe_types.h:192
DNA_listBase.h
These structs are the foundation for all linked lists in the library system.
GPUTexture
struct GPUTexture GPUTexture
Definition:
GPU_texture.h:33
Image
Definition:
imbuf/intern/dds/Image.h:36
AnimData
Definition:
DNA_anim_types.h:1083
Collection
Definition:
DNA_collection_types.h:60
ID
Definition:
DNA_ID.h:273
LightCacheTexture
Definition:
DNA_lightprobe_types.h:150
LightCacheTexture::data_type
char data_type
Definition:
DNA_lightprobe_types.h:155
LightCacheTexture::components
char components
Definition:
DNA_lightprobe_types.h:156
LightCacheTexture::data
char * data
Definition:
DNA_lightprobe_types.h:153
LightCacheTexture::tex
struct GPUTexture * tex
Definition:
DNA_lightprobe_types.h:151
LightCache
Definition:
DNA_lightprobe_types.h:160
LightCache::grid_data
LightGridCache * grid_data
Definition:
DNA_lightprobe_types.h:184
LightCache::cube_data
LightProbeCache * cube_data
Definition:
DNA_lightprobe_types.h:183
LightCache::type
int type
Definition:
DNA_lightprobe_types.h:165
LightCache::mips_len
int mips_len
Definition:
DNA_lightprobe_types.h:170
LightCache::grid_tx
LightCacheTexture grid_tx
Definition:
DNA_lightprobe_types.h:177
LightCache::flag
int flag
Definition:
DNA_lightprobe_types.h:161
LightCache::_pad
char _pad[4][2]
Definition:
DNA_lightprobe_types.h:173
LightCache::cube_len
int cube_len
Definition:
DNA_lightprobe_types.h:168
LightCache::cube_mips
LightCacheTexture * cube_mips
Definition:
DNA_lightprobe_types.h:181
LightCache::ref_res
int ref_res
Definition:
DNA_lightprobe_types.h:172
LightCache::cube_tx
LightCacheTexture cube_tx
Definition:
DNA_lightprobe_types.h:179
LightCache::version
int version
Definition:
DNA_lightprobe_types.h:163
LightCache::grid_len
int grid_len
Definition:
DNA_lightprobe_types.h:168
LightCache::vis_res
int vis_res
Definition:
DNA_lightprobe_types.h:172
LightGridCache
Definition:
DNA_lightprobe_types.h:132
LightGridCache::_pad4
float _pad4
Definition:
DNA_lightprobe_types.h:140
LightGridCache::attenuation_bias
float attenuation_bias
Definition:
DNA_lightprobe_types.h:138
LightGridCache::_pad5
float _pad5
Definition:
DNA_lightprobe_types.h:141
LightGridCache::offset
int offset
Definition:
DNA_lightprobe_types.h:135
LightGridCache::attenuation_scale
float attenuation_scale
Definition:
DNA_lightprobe_types.h:136
LightGridCache::visibility_bias
float visibility_bias
Definition:
DNA_lightprobe_types.h:141
LightGridCache::increment_z
float increment_z[3]
Definition:
DNA_lightprobe_types.h:140
LightGridCache::increment_y
float increment_y[3]
Definition:
DNA_lightprobe_types.h:139
LightGridCache::level_bias
float level_bias
Definition:
DNA_lightprobe_types.h:139
LightGridCache::visibility_bleed
float visibility_bleed
Definition:
DNA_lightprobe_types.h:141
LightGridCache::resolution
int resolution[3]
Definition:
DNA_lightprobe_types.h:135
LightGridCache::mat
float mat[4][4]
Definition:
DNA_lightprobe_types.h:133
LightGridCache::visibility_range
float visibility_range
Definition:
DNA_lightprobe_types.h:141
LightGridCache::increment_x
float increment_x[3]
Definition:
DNA_lightprobe_types.h:138
LightProbeCache
Definition:
DNA_lightprobe_types.h:122
LightProbeCache::position
float position[3]
Definition:
DNA_lightprobe_types.h:123
LightProbeCache::_pad3
float _pad3[2]
Definition:
DNA_lightprobe_types.h:126
LightProbeCache::attenuation_fac
float attenuation_fac
Definition:
DNA_lightprobe_types.h:124
LightProbeCache::parallax_type
float parallax_type
Definition:
DNA_lightprobe_types.h:123
LightProbeCache::parallaxmat
float parallaxmat[4][4]
Definition:
DNA_lightprobe_types.h:128
LightProbeCache::attenuationmat
float attenuationmat[4][4]
Definition:
DNA_lightprobe_types.h:127
LightProbeCache::attenuation_type
float attenuation_type
Definition:
DNA_lightprobe_types.h:125
LightProbe
Definition:
DNA_lightprobe_types.h:36
LightProbe::clipsta
float clipsta
Definition:
DNA_lightprobe_types.h:57
LightProbe::vis_blur
float vis_blur
Definition:
DNA_lightprobe_types.h:61
LightProbe::distfalloff
float distfalloff
Definition:
DNA_lightprobe_types.h:80
LightProbe::adt
struct AnimData * adt
Definition:
DNA_lightprobe_types.h:39
LightProbe::vis_bias
float vis_bias
Definition:
DNA_lightprobe_types.h:60
LightProbe::distpar
float distpar
Definition:
DNA_lightprobe_types.h:53
LightProbe::_pad
char _pad[8]
Definition:
DNA_lightprobe_types.h:81
LightProbe::flag
char flag
Definition:
DNA_lightprobe_types.h:44
LightProbe::falloff
float falloff
Definition:
DNA_lightprobe_types.h:55
LightProbe::attenuation_type
char attenuation_type
Definition:
DNA_lightprobe_types.h:46
LightProbe::distinf
float distinf
Definition:
DNA_lightprobe_types.h:51
LightProbe::parallax_ob
struct Object * parallax_ob
Definition:
DNA_lightprobe_types.h:73
LightProbe::grid_resolution_z
int grid_resolution_z
Definition:
DNA_lightprobe_types.h:69
LightProbe::grid_resolution_x
int grid_resolution_x
Definition:
DNA_lightprobe_types.h:67
LightProbe::vis_bleedbias
float vis_bleedbias
Definition:
DNA_lightprobe_types.h:60
LightProbe::visibility_grp
struct Collection * visibility_grp
Definition:
DNA_lightprobe_types.h:77
LightProbe::parallax_type
char parallax_type
Definition:
DNA_lightprobe_types.h:48
LightProbe::type
char type
Definition:
DNA_lightprobe_types.h:42
LightProbe::id
ID id
Definition:
DNA_lightprobe_types.h:37
LightProbe::distgridinf
float distgridinf
Definition:
DNA_lightprobe_types.h:80
LightProbe::intensity
float intensity
Definition:
DNA_lightprobe_types.h:64
LightProbe::_pad1
char _pad1[4]
Definition:
DNA_lightprobe_types.h:70
LightProbe::image
struct Image * image
Definition:
DNA_lightprobe_types.h:75
LightProbe::clipend
float clipend
Definition:
DNA_lightprobe_types.h:57
LightProbe::grid_resolution_y
int grid_resolution_y
Definition:
DNA_lightprobe_types.h:68
Object
Definition:
DNA_object_types.h:239
corner
Definition:
mball_tessellate.c:60
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1