summaryrefslogtreecommitdiffstats
path: root/drivers/gles3/shaders
diff options
context:
space:
mode:
authorClay <claynjohn@gmail.com>2023-07-24 23:21:04 +0200
committerClay <claynjohn@gmail.com>2023-07-24 23:21:04 +0200
commit7c812cd7e9aaa5145f5309bb6254d0570620bec9 (patch)
tree18cf99ecabb8fe06c6713b35c810b09ff8e3671f /drivers/gles3/shaders
parentf6187014ec1d7a47b7201f64f3a8376a5da2f42d (diff)
downloadredot-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.glsl18
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