2021-04-25 21:36:39 +00:00
|
|
|
#define LIGHT_BAKE_DISABLED 0
|
2021-11-26 16:47:37 +00:00
|
|
|
#define LIGHT_BAKE_STATIC 1
|
|
|
|
#define LIGHT_BAKE_DYNAMIC 2
|
2021-03-10 11:23:55 +00:00
|
|
|
|
|
|
|
struct LightData { //this structure needs to be as packed as possible
|
2021-08-11 00:50:28 +00:00
|
|
|
highp vec3 position;
|
2021-08-18 15:18:50 +00:00
|
|
|
highp float inv_radius;
|
2021-03-10 11:23:55 +00:00
|
|
|
|
2021-08-18 15:18:50 +00:00
|
|
|
mediump vec3 direction;
|
|
|
|
highp float size;
|
2021-03-10 11:23:55 +00:00
|
|
|
|
2021-08-18 15:18:50 +00:00
|
|
|
mediump vec3 color;
|
|
|
|
mediump float attenuation;
|
2021-03-10 11:23:55 +00:00
|
|
|
|
2021-08-18 15:18:50 +00:00
|
|
|
mediump float cone_attenuation;
|
|
|
|
mediump float cone_angle;
|
|
|
|
mediump float specular_amount;
|
2021-03-10 11:23:55 +00:00
|
|
|
bool shadow_enabled;
|
|
|
|
|
2021-08-11 00:50:28 +00:00
|
|
|
highp vec4 atlas_rect; // rect in the shadow atlas
|
|
|
|
highp mat4 shadow_matrix;
|
2021-08-18 15:18:50 +00:00
|
|
|
highp float shadow_bias;
|
|
|
|
highp float shadow_normal_bias;
|
|
|
|
highp float transmittance_bias;
|
|
|
|
highp float soft_shadow_size; // for spot, it's the size in uv coordinates of the light, for omni it's the span angle
|
|
|
|
highp float soft_shadow_scale; // scales the shadow kernel for blurrier shadows
|
2021-03-10 11:23:55 +00:00
|
|
|
uint mask;
|
2021-08-18 15:18:50 +00:00
|
|
|
mediump float shadow_volumetric_fog_fade;
|
2021-04-25 21:36:39 +00:00
|
|
|
uint bake_mode;
|
2021-08-11 00:50:28 +00:00
|
|
|
highp vec4 projector_rect; //projector rect in srgb decal atlas
|
2021-03-10 11:23:55 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#define REFLECTION_AMBIENT_DISABLED 0
|
|
|
|
#define REFLECTION_AMBIENT_ENVIRONMENT 1
|
|
|
|
#define REFLECTION_AMBIENT_COLOR 2
|
|
|
|
|
|
|
|
struct ReflectionData {
|
2021-08-18 15:18:50 +00:00
|
|
|
highp vec3 box_extents;
|
|
|
|
mediump float index;
|
|
|
|
highp vec3 box_offset;
|
2021-03-10 11:23:55 +00:00
|
|
|
uint mask;
|
2021-08-18 15:18:50 +00:00
|
|
|
mediump vec3 ambient; // ambient color
|
|
|
|
mediump float intensity;
|
2021-03-10 11:23:55 +00:00
|
|
|
bool exterior;
|
|
|
|
bool box_project;
|
|
|
|
uint ambient_mode;
|
|
|
|
uint pad;
|
|
|
|
//0-8 is intensity,8-9 is ambient, mode
|
2021-08-18 15:18:50 +00:00
|
|
|
highp mat4 local_matrix; // up to here for spot and omni, rest is for directional
|
2021-03-10 11:23:55 +00:00
|
|
|
// notes: for ambientblend, use distance to edge to blend between already existing global environment
|
|
|
|
};
|
|
|
|
|
|
|
|
struct DirectionalLightData {
|
2021-08-18 15:18:50 +00:00
|
|
|
mediump vec3 direction;
|
|
|
|
mediump float energy;
|
|
|
|
mediump vec3 color;
|
|
|
|
mediump float size;
|
|
|
|
mediump float specular;
|
2021-03-10 11:23:55 +00:00
|
|
|
uint mask;
|
2021-08-18 15:18:50 +00:00
|
|
|
highp float softshadow_angle;
|
|
|
|
highp float soft_shadow_scale;
|
2021-03-10 11:23:55 +00:00
|
|
|
bool blend_splits;
|
|
|
|
bool shadow_enabled;
|
2021-08-18 15:18:50 +00:00
|
|
|
highp float fade_from;
|
|
|
|
highp float fade_to;
|
2021-04-25 21:36:39 +00:00
|
|
|
uvec2 pad;
|
|
|
|
uint bake_mode;
|
2021-08-18 15:18:50 +00:00
|
|
|
mediump float shadow_volumetric_fog_fade;
|
|
|
|
highp vec4 shadow_bias;
|
|
|
|
highp vec4 shadow_normal_bias;
|
|
|
|
highp vec4 shadow_transmittance_bias;
|
2021-08-11 00:50:28 +00:00
|
|
|
highp vec4 shadow_z_range;
|
|
|
|
highp vec4 shadow_range_begin;
|
2021-08-18 15:18:50 +00:00
|
|
|
highp vec4 shadow_split_offsets;
|
2021-08-11 00:50:28 +00:00
|
|
|
highp mat4 shadow_matrix1;
|
|
|
|
highp mat4 shadow_matrix2;
|
|
|
|
highp mat4 shadow_matrix3;
|
|
|
|
highp mat4 shadow_matrix4;
|
2021-08-18 15:18:50 +00:00
|
|
|
mediump vec4 shadow_color1;
|
|
|
|
mediump vec4 shadow_color2;
|
|
|
|
mediump vec4 shadow_color3;
|
|
|
|
mediump vec4 shadow_color4;
|
|
|
|
highp vec2 uv_scale1;
|
|
|
|
highp vec2 uv_scale2;
|
|
|
|
highp vec2 uv_scale3;
|
|
|
|
highp vec2 uv_scale4;
|
2021-03-10 11:23:55 +00:00
|
|
|
};
|