You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-11 13:10:58 +00:00
Remove unused shadow_color property from Light3D
This shadow color property was no longer effective since the shaders were optimized to improve occupancy.
This commit is contained in:
@@ -76,10 +76,6 @@ struct DirectionalLightData {
|
||||
highp mat4 shadow_matrix2;
|
||||
highp mat4 shadow_matrix3;
|
||||
highp mat4 shadow_matrix4;
|
||||
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;
|
||||
|
||||
@@ -1124,7 +1124,6 @@ void main() {
|
||||
float depth_z = -vertex.z;
|
||||
|
||||
vec4 pssm_coord;
|
||||
vec3 shadow_color = vec3(0.0);
|
||||
vec3 light_dir = directional_lights.data[i].direction;
|
||||
|
||||
#define BIAS_FUNC(m_var, m_idx) \
|
||||
@@ -1150,9 +1149,6 @@ void main() {
|
||||
} else {
|
||||
shadow = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale, pssm_coord);
|
||||
}
|
||||
|
||||
shadow_color = directional_lights.data[i].shadow_color1.rgb;
|
||||
|
||||
} else if (depth_z < directional_lights.data[i].shadow_split_offsets.y) {
|
||||
vec4 v = vec4(vertex, 1.0);
|
||||
|
||||
@@ -1170,8 +1166,6 @@ void main() {
|
||||
} else {
|
||||
shadow = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale, pssm_coord);
|
||||
}
|
||||
|
||||
shadow_color = directional_lights.data[i].shadow_color2.rgb;
|
||||
} else if (depth_z < directional_lights.data[i].shadow_split_offsets.z) {
|
||||
vec4 v = vec4(vertex, 1.0);
|
||||
|
||||
@@ -1189,9 +1183,6 @@ void main() {
|
||||
} else {
|
||||
shadow = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale, pssm_coord);
|
||||
}
|
||||
|
||||
shadow_color = directional_lights.data[i].shadow_color3.rgb;
|
||||
|
||||
} else {
|
||||
vec4 v = vec4(vertex, 1.0);
|
||||
|
||||
@@ -1209,12 +1200,9 @@ void main() {
|
||||
} else {
|
||||
shadow = sample_directional_pcf_shadow(directional_shadow_atlas, scene_data.directional_shadow_pixel_size * directional_lights.data[i].soft_shadow_scale, pssm_coord);
|
||||
}
|
||||
|
||||
shadow_color = directional_lights.data[i].shadow_color4.rgb;
|
||||
}
|
||||
|
||||
if (directional_lights.data[i].blend_splits) {
|
||||
vec3 shadow_color_blend = vec3(0.0);
|
||||
float pssm_blend;
|
||||
float shadow2;
|
||||
|
||||
@@ -1235,7 +1223,6 @@ void main() {
|
||||
}
|
||||
|
||||
pssm_blend = smoothstep(0.0, directional_lights.data[i].shadow_split_offsets.x, depth_z);
|
||||
shadow_color_blend = directional_lights.data[i].shadow_color2.rgb;
|
||||
} else if (depth_z < directional_lights.data[i].shadow_split_offsets.y) {
|
||||
vec4 v = vec4(vertex, 1.0);
|
||||
BIAS_FUNC(v, 2)
|
||||
@@ -1253,8 +1240,6 @@ void main() {
|
||||
}
|
||||
|
||||
pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.x, directional_lights.data[i].shadow_split_offsets.y, depth_z);
|
||||
|
||||
shadow_color_blend = directional_lights.data[i].shadow_color3.rgb;
|
||||
} else if (depth_z < directional_lights.data[i].shadow_split_offsets.z) {
|
||||
vec4 v = vec4(vertex, 1.0);
|
||||
BIAS_FUNC(v, 3)
|
||||
@@ -1271,7 +1256,6 @@ void main() {
|
||||
}
|
||||
|
||||
pssm_blend = smoothstep(directional_lights.data[i].shadow_split_offsets.y, directional_lights.data[i].shadow_split_offsets.z, depth_z);
|
||||
shadow_color_blend = directional_lights.data[i].shadow_color4.rgb;
|
||||
} else {
|
||||
pssm_blend = 0.0; //if no blend, same coord will be used (divide by z will result in same value, and already cached)
|
||||
}
|
||||
@@ -1279,7 +1263,6 @@ void main() {
|
||||
pssm_blend = sqrt(pssm_blend);
|
||||
|
||||
shadow = mix(shadow, shadow2, pssm_blend);
|
||||
shadow_color = mix(shadow_color, shadow_color_blend, pssm_blend);
|
||||
}
|
||||
|
||||
shadow = mix(shadow, 1.0, smoothstep(directional_lights.data[i].fade_from, directional_lights.data[i].fade_to, vertex.z)); //done with negative values for performance
|
||||
|
||||
@@ -70,8 +70,6 @@ struct Light {
|
||||
float cos_spot_angle;
|
||||
float inv_spot_attenuation;
|
||||
float radius;
|
||||
|
||||
vec4 shadow_color;
|
||||
};
|
||||
|
||||
layout(set = 0, binding = 9, std140) buffer restrict readonly Lights {
|
||||
|
||||
@@ -382,7 +382,6 @@ void main() {
|
||||
float depth_z = -view_pos.z;
|
||||
|
||||
vec4 pssm_coord;
|
||||
vec3 shadow_color = directional_lights.data[i].shadow_color1.rgb;
|
||||
vec3 light_dir = directional_lights.data[i].direction;
|
||||
vec4 v = vec4(view_pos, 1.0);
|
||||
float z_range;
|
||||
@@ -413,7 +412,7 @@ void main() {
|
||||
|
||||
shadow = mix(shadow, 1.0, smoothstep(directional_lights.data[i].fade_from, directional_lights.data[i].fade_to, view_pos.z)); //done with negative values for performance
|
||||
|
||||
shadow_attenuation = mix(shadow_color, vec3(1.0), shadow);
|
||||
shadow_attenuation = mix(vec3(0.0), vec3(1.0), shadow);
|
||||
}
|
||||
|
||||
total_light += shadow_attenuation * directional_lights.data[i].color * directional_lights.data[i].energy * henyey_greenstein(dot(normalize(view_pos), normalize(directional_lights.data[i].direction)), params.phase_g);
|
||||
|
||||
Reference in New Issue
Block a user