mirror of
https://github.com/godotengine/godot.git
synced 2025-12-08 06:09:55 +00:00
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:
parent
f6187014ec
commit
7c812cd7e9
6 changed files with 27 additions and 17 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue