| 1 |
#define LIGHT_BAKE_DISABLED 0 |
| 2 |
#define LIGHT_BAKE_STATIC 1 |
| 3 |
#define LIGHT_BAKE_DYNAMIC 2 |
| 4 |
|
| 5 |
struct LightData { //this structure needs to be as packed as possible |
| 6 |
vec3 position; |
| 7 |
float inv_radius; |
| 8 |
|
| 9 |
vec3 direction; |
| 10 |
float size; |
| 11 |
|
| 12 |
vec3 color; |
| 13 |
float attenuation; |
| 14 |
|
| 15 |
float cone_attenuation; |
| 16 |
float cone_angle; |
| 17 |
float specular_amount; |
| 18 |
float shadow_opacity; |
| 19 |
|
| 20 |
vec4 atlas_rect; // rect in the shadow atlas |
| 21 |
mat4 shadow_matrix; |
| 22 |
float shadow_bias; |
| 23 |
float shadow_normal_bias; |
| 24 |
float transmittance_bias; |
| 25 |
float soft_shadow_size; // for spot, it's the size in uv coordinates of the light, for omni it's the span angle |
| 26 |
float soft_shadow_scale; // scales the shadow kernel for blurrier shadows |
| 27 |
uint mask; |
| 28 |
float volumetric_fog_energy; |
| 29 |
uint bake_mode; |
| 30 |
vec4 projector_rect; //projector rect in srgb decal atlas |
| 31 |
}; |
| 32 |
|
| 33 |
#define REFLECTION_AMBIENT_DISABLED 0 |
| 34 |
#define REFLECTION_AMBIENT_ENVIRONMENT 1 |
| 35 |
#define REFLECTION_AMBIENT_COLOR 2 |
| 36 |
|
| 37 |
struct ReflectionData { |
| 38 |
vec3 box_extents; |
| 39 |
float index; |
| 40 |
vec3 box_offset; |
| 41 |
uint mask; |
| 42 |
vec3 ambient; // ambient color |
| 43 |
float intensity; |
| 44 |
float blend_distance; |
| 45 |
bool exterior; |
| 46 |
bool box_project; |
| 47 |
uint ambient_mode; |
| 48 |
float exposure_normalization; |
| 49 |
float pad0; |
| 50 |
float pad1; |
| 51 |
float pad2; |
| 52 |
//0-8 is intensity,8-9 is ambient, mode |
| 53 |
mat4 local_matrix; // up to here for spot and omni, rest is for directional |
| 54 |
// notes: for ambientblend, use distance to edge to blend between already existing global environment |
| 55 |
}; |
| 56 |
|
| 57 |
struct DirectionalLightData { |
| 58 |
vec3 direction; |
| 59 |
float energy; // needs to be highp to avoid NaNs being created with high energy values (i.e. when using physical light units and over-exposing the image) |
| 60 |
vec3 color; |
| 61 |
float size; |
| 62 |
float specular; |
| 63 |
uint mask; |
| 64 |
float softshadow_angle; |
| 65 |
float soft_shadow_scale; |
| 66 |
bool blend_splits; |
| 67 |
float shadow_opacity; |
| 68 |
float fade_from; |
| 69 |
float fade_to; |
| 70 |
uvec2 pad; |
| 71 |
uint bake_mode; |
| 72 |
float volumetric_fog_energy; |
| 73 |
vec4 shadow_bias; |
| 74 |
vec4 shadow_normal_bias; |
| 75 |
vec4 shadow_transmittance_bias; |
| 76 |
vec4 shadow_z_range; |
| 77 |
vec4 shadow_range_begin; |
| 78 |
vec4 shadow_split_offsets; |
| 79 |
mat4 shadow_matrix1; |
| 80 |
mat4 shadow_matrix2; |
| 81 |
mat4 shadow_matrix3; |
| 82 |
mat4 shadow_matrix4; |
| 83 |
vec2 uv_scale1; |
| 84 |
vec2 uv_scale2; |
| 85 |
vec2 uv_scale3; |
| 86 |
vec2 uv_scale4; |
| 87 |
}; |