Blender
V3.3
source
blender
makesdna
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
;
32
char
attenuation_type
;
34
char
parallax_type
;
35
37
float
distinf
;
39
float
distpar
;
41
float
falloff
;
42
43
float
clipsta
,
clipend
;
44
46
float
vis_bias
,
vis_bleedbias
;
47
float
vis_blur
;
48
50
float
intensity
;
51
53
int
grid_resolution_x
;
54
int
grid_resolution_y
;
55
int
grid_resolution_z
;
56
char
_pad1
[4];
57
59
struct
Object
*
parallax_ob
;
61
struct
Image
*
image
;
63
struct
Collection
*
visibility_grp
;
64
65
/* Runtime display data */
66
float
distfalloff
,
distgridinf
;
67
char
_pad
[8];
68
}
LightProbe
;
69
70
/* Probe->type */
71
enum
{
72
LIGHTPROBE_TYPE_CUBE
= 0,
73
LIGHTPROBE_TYPE_PLANAR
= 1,
74
LIGHTPROBE_TYPE_GRID
= 2,
75
};
76
77
/* Probe->flag */
78
enum
{
79
LIGHTPROBE_FLAG_CUSTOM_PARALLAX
= (1 << 0),
80
LIGHTPROBE_FLAG_SHOW_INFLUENCE
= (1 << 1),
81
LIGHTPROBE_FLAG_SHOW_PARALLAX
= (1 << 2),
82
LIGHTPROBE_FLAG_SHOW_CLIP_DIST
= (1 << 3),
83
LIGHTPROBE_FLAG_SHOW_DATA
= (1 << 4),
84
LIGHTPROBE_FLAG_INVERT_GROUP
= (1 << 5),
85
};
86
87
/* Probe->display */
88
enum
{
89
LIGHTPROBE_DISP_WIRE
= 0,
90
LIGHTPROBE_DISP_SHADED
= 1,
91
LIGHTPROBE_DISP_DIFFUSE
= 2,
92
LIGHTPROBE_DISP_REFLECTIVE
= 3,
93
};
94
95
/* Probe->parallax && Probe->attenuation_type. */
96
enum
{
97
LIGHTPROBE_SHAPE_ELIPSOID
= 0,
98
LIGHTPROBE_SHAPE_BOX
= 1,
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
{
109
float
position
[3],
parallax_type
;
110
float
attenuation_fac
;
111
float
attenuation_type
;
112
float
_pad3
[2];
113
float
attenuationmat
[4][4];
114
float
parallaxmat
[4][4];
115
}
LightProbeCache
;
116
117
/* Must match GridData. */
118
typedef
struct
LightGridCache
{
119
float
mat
[4][4];
121
int
resolution
[3],
offset
;
122
float
corner
[3],
attenuation_scale
;
124
float
increment_x
[3],
attenuation_bias
;
125
float
increment_y
[3],
level_bias
;
126
float
increment_z
[3],
_pad4
;
127
float
visibility_bias
,
visibility_bleed
,
visibility_range
,
_pad5
;
128
}
LightGridCache
;
129
130
/* These are used as UBO data. They need to be aligned to size of vec4. */
131
BLI_STATIC_ASSERT_ALIGN
(
LightProbeCache
, 16)
132
BLI_STATIC_ASSERT_ALIGN
(
LightGridCache
, 16)
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
;
142
char
components
;
143
char
_pad[2];
144
}
LightCacheTexture
;
145
146
typedef
struct
LightCache
{
147
int
flag
;
149
int
version
;
151
int
type
;
152
/* only a single cache for now */
154
int
cube_len
,
grid_len
;
156
int
mips_len
;
158
int
vis_res
,
ref_res
;
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. */
163
LightCacheTexture
grid_tx
;
165
LightCacheTexture
cube_tx
;
167
LightCacheTexture
*
cube_mips
;
168
/* All lightprobes data contained in the cache. */
169
LightProbeCache
*
cube_data
;
170
LightGridCache
*
grid_data
;
171
}
LightCache
;
172
173
/* Bump the version number for lightcache data structure changes. */
174
#define LIGHTCACHE_STATIC_VERSION 2
175
176
/* LightCache->type */
177
enum
{
178
LIGHTCACHE_TYPE_STATIC
= 0,
179
};
180
181
/* LightCache->flag */
182
enum
{
183
LIGHTCACHE_BAKED
= (1 << 0),
184
LIGHTCACHE_BAKING
= (1 << 1),
185
LIGHTCACHE_CUBE_READY
= (1 << 2),
186
LIGHTCACHE_GRID_READY
= (1 << 3),
187
/* Update tagging */
188
LIGHTCACHE_UPDATE_CUBE
= (1 << 4),
189
LIGHTCACHE_UPDATE_GRID
= (1 << 5),
190
LIGHTCACHE_UPDATE_WORLD
= (1 << 6),
191
LIGHTCACHE_UPDATE_AUTO
= (1 << 7),
193
LIGHTCACHE_INVALID
= (1 << 8),
195
LIGHTCACHE_NOT_USABLE
= (1 << 9),
196
};
197
198
/* EEVEE_LightCacheTexture->data_type */
199
enum
{
200
LIGHTCACHETEX_BYTE
= (1 << 0),
201
LIGHTCACHETEX_FLOAT
= (1 << 1),
202
LIGHTCACHETEX_UINT
= (1 << 2),
203
};
204
205
#ifdef __cplusplus
206
}
207
#endif
BLI_assert.h
BLI_STATIC_ASSERT_ALIGN
#define BLI_STATIC_ASSERT_ALIGN(st, align)
Definition:
BLI_assert.h:86
DNA_ID.h
ID and Library types, which are fundamental for sdna.
DNA_defs.h
LIGHTPROBE_DISP_SHADED
@ LIGHTPROBE_DISP_SHADED
Definition:
DNA_lightprobe_types.h:90
LIGHTPROBE_DISP_REFLECTIVE
@ LIGHTPROBE_DISP_REFLECTIVE
Definition:
DNA_lightprobe_types.h:92
LIGHTPROBE_DISP_WIRE
@ LIGHTPROBE_DISP_WIRE
Definition:
DNA_lightprobe_types.h:89
LIGHTPROBE_DISP_DIFFUSE
@ LIGHTPROBE_DISP_DIFFUSE
Definition:
DNA_lightprobe_types.h:91
LIGHTCACHETEX_FLOAT
@ LIGHTCACHETEX_FLOAT
Definition:
DNA_lightprobe_types.h:201
LIGHTCACHETEX_BYTE
@ LIGHTCACHETEX_BYTE
Definition:
DNA_lightprobe_types.h:200
LIGHTCACHETEX_UINT
@ LIGHTCACHETEX_UINT
Definition:
DNA_lightprobe_types.h:202
LIGHTPROBE_SHAPE_BOX
@ LIGHTPROBE_SHAPE_BOX
Definition:
DNA_lightprobe_types.h:98
LIGHTPROBE_SHAPE_ELIPSOID
@ LIGHTPROBE_SHAPE_ELIPSOID
Definition:
DNA_lightprobe_types.h:97
LightGridCache
struct LightGridCache LightGridCache
LightProbeCache
struct LightProbeCache LightProbeCache
LightCacheTexture
struct LightCacheTexture LightCacheTexture
LightCache
struct LightCache LightCache
LightProbe
struct LightProbe LightProbe
LIGHTCACHE_UPDATE_WORLD
@ LIGHTCACHE_UPDATE_WORLD
Definition:
DNA_lightprobe_types.h:190
LIGHTCACHE_BAKING
@ LIGHTCACHE_BAKING
Definition:
DNA_lightprobe_types.h:184
LIGHTCACHE_BAKED
@ LIGHTCACHE_BAKED
Definition:
DNA_lightprobe_types.h:183
LIGHTCACHE_GRID_READY
@ LIGHTCACHE_GRID_READY
Definition:
DNA_lightprobe_types.h:186
LIGHTCACHE_UPDATE_AUTO
@ LIGHTCACHE_UPDATE_AUTO
Definition:
DNA_lightprobe_types.h:191
LIGHTCACHE_NOT_USABLE
@ LIGHTCACHE_NOT_USABLE
Definition:
DNA_lightprobe_types.h:195
LIGHTCACHE_UPDATE_GRID
@ LIGHTCACHE_UPDATE_GRID
Definition:
DNA_lightprobe_types.h:189
LIGHTCACHE_CUBE_READY
@ LIGHTCACHE_CUBE_READY
Definition:
DNA_lightprobe_types.h:185
LIGHTCACHE_INVALID
@ LIGHTCACHE_INVALID
Definition:
DNA_lightprobe_types.h:193
LIGHTCACHE_UPDATE_CUBE
@ LIGHTCACHE_UPDATE_CUBE
Definition:
DNA_lightprobe_types.h:188
LIGHTPROBE_TYPE_CUBE
@ LIGHTPROBE_TYPE_CUBE
Definition:
DNA_lightprobe_types.h:72
LIGHTPROBE_TYPE_PLANAR
@ LIGHTPROBE_TYPE_PLANAR
Definition:
DNA_lightprobe_types.h:73
LIGHTPROBE_TYPE_GRID
@ LIGHTPROBE_TYPE_GRID
Definition:
DNA_lightprobe_types.h:74
LIGHTCACHE_TYPE_STATIC
@ LIGHTCACHE_TYPE_STATIC
Definition:
DNA_lightprobe_types.h:178
LIGHTPROBE_FLAG_SHOW_PARALLAX
@ LIGHTPROBE_FLAG_SHOW_PARALLAX
Definition:
DNA_lightprobe_types.h:81
LIGHTPROBE_FLAG_SHOW_CLIP_DIST
@ LIGHTPROBE_FLAG_SHOW_CLIP_DIST
Definition:
DNA_lightprobe_types.h:82
LIGHTPROBE_FLAG_SHOW_INFLUENCE
@ LIGHTPROBE_FLAG_SHOW_INFLUENCE
Definition:
DNA_lightprobe_types.h:80
LIGHTPROBE_FLAG_INVERT_GROUP
@ LIGHTPROBE_FLAG_INVERT_GROUP
Definition:
DNA_lightprobe_types.h:84
LIGHTPROBE_FLAG_SHOW_DATA
@ LIGHTPROBE_FLAG_SHOW_DATA
Definition:
DNA_lightprobe_types.h:83
LIGHTPROBE_FLAG_CUSTOM_PARALLAX
@ LIGHTPROBE_FLAG_CUSTOM_PARALLAX
Definition:
DNA_lightprobe_types.h:79
DNA_listBase.h
These structs are the foundation for all linked lists in the library system.
GPUTexture
struct GPUTexture GPUTexture
Definition:
GPU_texture.h:17
Image
Definition:
imbuf/intern/dds/Image.h:22
AnimData
Definition:
DNA_anim_types.h:1068
Collection
Definition:
DNA_collection_types.h:47
ID
Definition:
DNA_ID.h:368
LightCacheTexture
Definition:
DNA_lightprobe_types.h:136
LightCacheTexture::data_type
char data_type
Definition:
DNA_lightprobe_types.h:141
LightCacheTexture::components
char components
Definition:
DNA_lightprobe_types.h:142
LightCacheTexture::data
char * data
Definition:
DNA_lightprobe_types.h:139
LightCacheTexture::tex
struct GPUTexture * tex
Definition:
DNA_lightprobe_types.h:137
LightCache
Definition:
DNA_lightprobe_types.h:146
LightCache::grid_data
LightGridCache * grid_data
Definition:
DNA_lightprobe_types.h:170
LightCache::cube_data
LightProbeCache * cube_data
Definition:
DNA_lightprobe_types.h:169
LightCache::type
int type
Definition:
DNA_lightprobe_types.h:151
LightCache::mips_len
int mips_len
Definition:
DNA_lightprobe_types.h:156
LightCache::grid_tx
LightCacheTexture grid_tx
Definition:
DNA_lightprobe_types.h:163
LightCache::flag
int flag
Definition:
DNA_lightprobe_types.h:147
LightCache::_pad
char _pad[4][2]
Definition:
DNA_lightprobe_types.h:159
LightCache::cube_len
int cube_len
Definition:
DNA_lightprobe_types.h:154
LightCache::cube_mips
LightCacheTexture * cube_mips
Definition:
DNA_lightprobe_types.h:167
LightCache::ref_res
int ref_res
Definition:
DNA_lightprobe_types.h:158
LightCache::cube_tx
LightCacheTexture cube_tx
Definition:
DNA_lightprobe_types.h:165
LightCache::version
int version
Definition:
DNA_lightprobe_types.h:149
LightCache::grid_len
int grid_len
Definition:
DNA_lightprobe_types.h:154
LightCache::vis_res
int vis_res
Definition:
DNA_lightprobe_types.h:158
LightGridCache
Definition:
DNA_lightprobe_types.h:118
LightGridCache::_pad4
float _pad4
Definition:
DNA_lightprobe_types.h:126
LightGridCache::attenuation_bias
float attenuation_bias
Definition:
DNA_lightprobe_types.h:124
LightGridCache::_pad5
float _pad5
Definition:
DNA_lightprobe_types.h:127
LightGridCache::offset
int offset
Definition:
DNA_lightprobe_types.h:121
LightGridCache::attenuation_scale
float attenuation_scale
Definition:
DNA_lightprobe_types.h:122
LightGridCache::visibility_bias
float visibility_bias
Definition:
DNA_lightprobe_types.h:127
LightGridCache::increment_z
float increment_z[3]
Definition:
DNA_lightprobe_types.h:126
LightGridCache::increment_y
float increment_y[3]
Definition:
DNA_lightprobe_types.h:125
LightGridCache::level_bias
float level_bias
Definition:
DNA_lightprobe_types.h:125
LightGridCache::visibility_bleed
float visibility_bleed
Definition:
DNA_lightprobe_types.h:127
LightGridCache::resolution
int resolution[3]
Definition:
DNA_lightprobe_types.h:121
LightGridCache::mat
float mat[4][4]
Definition:
DNA_lightprobe_types.h:119
LightGridCache::visibility_range
float visibility_range
Definition:
DNA_lightprobe_types.h:127
LightGridCache::increment_x
float increment_x[3]
Definition:
DNA_lightprobe_types.h:124
LightProbeCache
Definition:
DNA_lightprobe_types.h:108
LightProbeCache::position
float position[3]
Definition:
DNA_lightprobe_types.h:109
LightProbeCache::_pad3
float _pad3[2]
Definition:
DNA_lightprobe_types.h:112
LightProbeCache::attenuation_fac
float attenuation_fac
Definition:
DNA_lightprobe_types.h:110
LightProbeCache::parallax_type
float parallax_type
Definition:
DNA_lightprobe_types.h:109
LightProbeCache::parallaxmat
float parallaxmat[4][4]
Definition:
DNA_lightprobe_types.h:114
LightProbeCache::attenuationmat
float attenuationmat[4][4]
Definition:
DNA_lightprobe_types.h:113
LightProbeCache::attenuation_type
float attenuation_type
Definition:
DNA_lightprobe_types.h:111
LightProbe
Definition:
DNA_lightprobe_types.h:22
LightProbe::clipsta
float clipsta
Definition:
DNA_lightprobe_types.h:43
LightProbe::vis_blur
float vis_blur
Definition:
DNA_lightprobe_types.h:47
LightProbe::distfalloff
float distfalloff
Definition:
DNA_lightprobe_types.h:66
LightProbe::adt
struct AnimData * adt
Definition:
DNA_lightprobe_types.h:25
LightProbe::vis_bias
float vis_bias
Definition:
DNA_lightprobe_types.h:46
LightProbe::distpar
float distpar
Definition:
DNA_lightprobe_types.h:39
LightProbe::_pad
char _pad[8]
Definition:
DNA_lightprobe_types.h:67
LightProbe::flag
char flag
Definition:
DNA_lightprobe_types.h:30
LightProbe::falloff
float falloff
Definition:
DNA_lightprobe_types.h:41
LightProbe::attenuation_type
char attenuation_type
Definition:
DNA_lightprobe_types.h:32
LightProbe::distinf
float distinf
Definition:
DNA_lightprobe_types.h:37
LightProbe::parallax_ob
struct Object * parallax_ob
Definition:
DNA_lightprobe_types.h:59
LightProbe::grid_resolution_z
int grid_resolution_z
Definition:
DNA_lightprobe_types.h:55
LightProbe::grid_resolution_x
int grid_resolution_x
Definition:
DNA_lightprobe_types.h:53
LightProbe::vis_bleedbias
float vis_bleedbias
Definition:
DNA_lightprobe_types.h:46
LightProbe::visibility_grp
struct Collection * visibility_grp
Definition:
DNA_lightprobe_types.h:63
LightProbe::parallax_type
char parallax_type
Definition:
DNA_lightprobe_types.h:34
LightProbe::type
char type
Definition:
DNA_lightprobe_types.h:28
LightProbe::id
ID id
Definition:
DNA_lightprobe_types.h:23
LightProbe::distgridinf
float distgridinf
Definition:
DNA_lightprobe_types.h:66
LightProbe::intensity
float intensity
Definition:
DNA_lightprobe_types.h:50
LightProbe::_pad1
char _pad1[4]
Definition:
DNA_lightprobe_types.h:56
LightProbe::image
struct Image * image
Definition:
DNA_lightprobe_types.h:61
LightProbe::clipend
float clipend
Definition:
DNA_lightprobe_types.h:43
LightProbe::grid_resolution_y
int grid_resolution_y
Definition:
DNA_lightprobe_types.h:54
Object
Definition:
DNA_object_types.h:242
corner
Definition:
mball_tessellate.c:46
Generated on Tue Oct 22 2024 13:18:25 for Blender by
doxygen
1.9.1