diff --git a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl index 8e6db7583ea7..206c2fb24528 100644 --- a/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_clustered/scene_forward_clustered.glsl @@ -1019,13 +1019,11 @@ void fragment_shader(in SceneData scene_data) { #endif // ALPHA_ANTIALIASING_EDGE_USED #ifdef MODE_RENDER_DEPTH -#ifdef USE_OPAQUE_PREPASS -#ifndef ALPHA_SCISSOR_USED +#if defined(USE_OPAQUE_PREPASS) || defined(ALPHA_ANTIALIASING_EDGE_USED) if (alpha < scene_data.opaque_prepass_threshold) { discard; } -#endif // !ALPHA_SCISSOR_USED -#endif // USE_OPAQUE_PREPASS +#endif // USE_OPAQUE_PREPASS || ALPHA_ANTIALIASING_EDGE_USED #endif // MODE_RENDER_DEPTH #endif // !USE_SHADOW_TO_OPACITY diff --git a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl index a9e9a617d658..5ed36697030c 100644 --- a/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl +++ b/servers/rendering/renderer_rd/shaders/forward_mobile/scene_forward_mobile.glsl @@ -854,13 +854,11 @@ void main() { #endif // ALPHA_ANTIALIASING_EDGE_USED #ifdef MODE_RENDER_DEPTH -#ifdef USE_OPAQUE_PREPASS -#ifndef ALPHA_SCISSOR_USED +#if defined(USE_OPAQUE_PREPASS) || defined(ALPHA_ANTIALIASING_EDGE_USED) if (alpha < scene_data.opaque_prepass_threshold) { discard; } -#endif // !ALPHA_SCISSOR_USED -#endif // USE_OPAQUE_PREPASS +#endif // USE_OPAQUE_PREPASS || ALPHA_ANTIALIASING_EDGE_USED #endif // MODE_RENDER_DEPTH #endif // !USE_SHADOW_TO_OPACITY