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
This commit is contained in:
Clay 2023-07-24 23:21:04 +02:00
parent f6187014ec
commit 7c812cd7e9
6 changed files with 27 additions and 17 deletions

View file

@ -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