diff options
author | Clay <claynjohn@gmail.com> | 2023-07-24 23:21:04 +0200 |
---|---|---|
committer | Clay <claynjohn@gmail.com> | 2023-07-24 23:21:04 +0200 |
commit | 7c812cd7e9aaa5145f5309bb6254d0570620bec9 (patch) | |
tree | 18cf99ecabb8fe06c6713b35c810b09ff8e3671f /drivers/gles3/shaders | |
parent | f6187014ec1d7a47b7201f64f3a8376a5da2f42d (diff) | |
download | redot-engine-7c812cd7e9aaa5145f5309bb6254d0570620bec9.tar.gz |
Fix use of discard in shaders
discard was being included in all shaders set to depth pass opaque, which is the majority of shaders
Instead it should only be used with alpha prepass materials
Diffstat (limited to 'drivers/gles3/shaders')
-rw-r--r-- | drivers/gles3/shaders/scene.glsl | 18 |
1 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gles3/shaders/scene.glsl b/drivers/gles3/shaders/scene.glsl index aa68febec8..7cba77be2f 100644 --- a/drivers/gles3/shaders/scene.glsl +++ b/drivers/gles3/shaders/scene.glsl @@ -1039,17 +1039,16 @@ void main() { if (alpha < alpha_scissor_threshold) { discard; } -#endif // ALPHA_SCISSOR_USED - +#else +#ifdef MODE_RENDER_DEPTH #ifdef USE_OPAQUE_PREPASS -#if !defined(ALPHA_SCISSOR_USED) if (alpha < opaque_prepass_threshold) { discard; } - -#endif // not ALPHA_SCISSOR_USED #endif // USE_OPAQUE_PREPASS +#endif // MODE_RENDER_DEPTH +#endif // !ALPHA_SCISSOR_USED #endif // !USE_SHADOW_TO_OPACITY @@ -1270,17 +1269,16 @@ void main() { if (alpha < alpha_scissor) { discard; } -#endif // ALPHA_SCISSOR_USED - +#else +#ifdef MODE_RENDER_DEPTH #ifdef USE_OPAQUE_PREPASS -#if !defined(ALPHA_SCISSOR_USED) if (alpha < opaque_prepass_threshold) { discard; } - -#endif // not ALPHA_SCISSOR_USED #endif // USE_OPAQUE_PREPASS +#endif // MODE_RENDER_DEPTH +#endif // !ALPHA_SCISSOR_USED #endif // USE_SHADOW_TO_OPACITY |