summaryrefslogtreecommitdiff
path: root/servers/rendering/renderer_rd/shaders/environment
diff options
context:
space:
mode:
authorHugo Locurcio <hugo.locurcio@hugo.pro>2022-06-10 12:47:06 +0200
committerHugo Locurcio <hugo.locurcio@hugo.pro>2022-08-07 11:06:32 +0200
commitbaaa7503c7e0c83c94edf651ac31f03e0ceddac0 (patch)
tree9a7373cb1f942c4308454e01eacea67b56f0336d /servers/rendering/renderer_rd/shaders/environment
parentf85a81696569108c8b4e5cd2f747f3e9c2699b1f (diff)
Add a shadow opacity property to Light3D
This can be used to make shadows translucent for a specific light. The light distance fade system also uses this to smoothly fade the shadow when the light fade transition distance is greater than 0.
Diffstat (limited to 'servers/rendering/renderer_rd/shaders/environment')
-rw-r--r--servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl6
1 files changed, 3 insertions, 3 deletions
diff --git a/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl b/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl
index e74cfad65c..6f79b9e771 100644
--- a/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl
+++ b/servers/rendering/renderer_rd/shaders/environment/volumetric_fog_process.glsl
@@ -377,7 +377,7 @@ void main() {
for (uint i = 0; i < params.directional_light_count; i++) {
vec3 shadow_attenuation = vec3(1.0);
- if (directional_lights.data[i].shadow_enabled) {
+ if (directional_lights.data[i].shadow_opacity > 0.001) {
float depth_z = -view_pos.z;
vec4 pssm_coord;
@@ -486,7 +486,7 @@ void main() {
vec3 light = omni_lights.data[light_index].color;
- if (omni_lights.data[light_index].shadow_enabled) {
+ if (omni_lights.data[light_index].shadow_opacity > 0.001) {
//has shadow
vec4 uv_rect = omni_lights.data[light_index].atlas_rect;
vec2 flip_offset = omni_lights.data[light_index].direction.xy;
@@ -572,7 +572,7 @@ void main() {
vec3 light = spot_lights.data[light_index].color;
- if (spot_lights.data[light_index].shadow_enabled) {
+ if (spot_lights.data[light_index].shadow_opacity > 0.001) {
//has shadow
vec4 uv_rect = spot_lights.data[light_index].atlas_rect;
vec2 flip_offset = spot_lights.data[light_index].direction.xy;