diff options
author | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2019-11-29 06:21:17 +0100 |
---|---|---|
committer | PouleyKetchoupp <pouleyketchoup@gmail.com> | 2019-11-29 06:21:17 +0100 |
commit | 299b85c46fa732c06fc8ac0b6d193a6ddc5eb6e6 (patch) | |
tree | c315b3e15185c6c914d20004d84a531d3e1ddae8 /drivers/gles3/shaders | |
parent | 7735af7e768e16efb4b3b6de1c72c3dfb50c9412 (diff) |
Disable shadow map sampling when shadows are not used in GLES3
Fixes #20742
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index e1b0e9f595..088fa12592 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1256,6 +1256,7 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi vec3 light_attenuation = vec3(omni_attenuation); #if !defined(SHADOWS_DISABLED) +#ifdef USE_SHADOW if (omni_lights[idx].light_params.w > 0.5) { // there is a shadowmap @@ -1300,6 +1301,7 @@ void light_process_omni(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi #endif light_attenuation *= mix(omni_lights[idx].shadow_color_contact.rgb, vec3(1.0), shadow); } +#endif //USE_SHADOW #endif //SHADOWS_DISABLED light_compute(normal, normalize(light_rel_vec), eye_vec, binormal, tangent, omni_lights[idx].light_color_energy.rgb, light_attenuation, albedo, transmission, omni_lights[idx].light_params.z * p_blob_intensity, roughness, metallic, specular, rim * omni_attenuation, rim_tint, clearcoat, clearcoat_gloss, anisotropy, diffuse_light, specular_light, alpha); } @@ -1318,6 +1320,7 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi vec3 light_attenuation = vec3(spot_attenuation); #if !defined(SHADOWS_DISABLED) +#ifdef USE_SHADOW if (spot_lights[idx].light_params.w > 0.5) { //there is a shadowmap highp vec4 splane = (spot_lights[idx].shadow_matrix * vec4(vertex, 1.0)); @@ -1334,6 +1337,7 @@ void light_process_spot(int idx, vec3 vertex, vec3 eye_vec, vec3 normal, vec3 bi #endif light_attenuation *= mix(spot_lights[idx].shadow_color_contact.rgb, vec3(1.0), shadow); } +#endif //USE_SHADOW #endif //SHADOWS_DISABLED light_compute(normal, normalize(light_rel_vec), eye_vec, binormal, tangent, spot_lights[idx].light_color_energy.rgb, light_attenuation, albedo, transmission, spot_lights[idx].light_params.z * p_blob_intensity, roughness, metallic, specular, rim * spot_attenuation, rim_tint, clearcoat, clearcoat_gloss, anisotropy, diffuse_light, specular_light, alpha); |