Skip to content

Commit

Permalink
Don't use prepass threshold with alpha scissor
Browse files Browse the repository at this point in the history
  • Loading branch information
Firepal committed Feb 11, 2022
1 parent cf555f0 commit ff55157
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
8 changes: 8 additions & 0 deletions drivers/gles2/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1695,9 +1695,13 @@ FRAGMENT_SHADER_CODE
#endif // ALPHA_SCISSOR_USED

#ifdef USE_DEPTH_PREPASS
#if !defined(ALPHA_SCISSOR_USED)

if (alpha < 0.1) {
discard;
}

#endif // not ALPHA_SCISSOR_USED
#endif // USE_DEPTH_PREPASS

#endif // !USE_SHADOW_TO_OPACITY
Expand Down Expand Up @@ -2255,9 +2259,13 @@ FRAGMENT_SHADER_CODE
#endif // ALPHA_SCISSOR_USED

#ifdef USE_DEPTH_PREPASS
#if !defined(ALPHA_SCISSOR_USED)

if (alpha < 0.1) {
discard;
}

#endif // not ALPHA_SCISSOR_USED
#endif // USE_DEPTH_PREPASS

#endif // !USE_SHADOW_TO_OPACITY
Expand Down
5 changes: 5 additions & 0 deletions drivers/gles3/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1902,11 +1902,13 @@ FRAGMENT_SHADER_CODE
#endif // ALPHA_SCISSOR_USED

#ifdef USE_OPAQUE_PREPASS //ubershader-runtime
#if !defined(ALPHA_SCISSOR_USED)

if (alpha < opaque_prepass_threshold) {
discard;
}

#endif // not ALPHA_SCISSOR_USED
#endif // USE_OPAQUE_PREPASS //ubershader-runtime

#endif // !USE_SHADOW_TO_OPACITY
Expand Down Expand Up @@ -2282,10 +2284,13 @@ FRAGMENT_SHADER_CODE
#endif // ALPHA_SCISSOR_USED

#ifdef USE_OPAQUE_PREPASS //ubershader-runtime
#if !defined(ALPHA_SCISSOR_USED)

if (alpha < opaque_prepass_threshold) {
discard;
}

#endif // not ALPHA_SCISSOR_USED
#endif // USE_OPAQUE_PREPASS //ubershader-runtime

#endif // USE_SHADOW_TO_OPACITY
Expand Down

0 comments on commit ff55157

Please sign in to comment.