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 Jan 22, 2021
1 parent 2d90412 commit e189913
Show file tree
Hide file tree
Showing 2 changed files with 12 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 @@ -1603,9 +1603,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 @@ -2161,9 +2165,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
4 changes: 4 additions & 0 deletions drivers/gles3/shaders/scene.glsl
Original file line number Diff line number Diff line change
Expand Up @@ -1809,11 +1809,13 @@ FRAGMENT_SHADER_CODE
#endif // ALPHA_SCISSOR_USED

#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 // !USE_SHADOW_TO_OPACITY
Expand Down Expand Up @@ -2188,11 +2190,13 @@ FRAGMENT_SHADER_CODE
#endif // ALPHA_SCISSOR_USED

#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 // USE_SHADOW_TO_OPACITY
Expand Down

0 comments on commit e189913

Please sign in to comment.