Browse Source

Shaders: make alpha mask = 1.0 do what's expected.

Yay tests!
pull/364/head
Vladimír Vondruš 7 years ago
parent
commit
08f6615048
  1. 5
      src/Magnum/Shaders/Flat.frag
  2. 5
      src/Magnum/Shaders/Phong.frag

5
src/Magnum/Shaders/Flat.frag

@ -72,6 +72,9 @@ void main() {
color; color;
#ifdef ALPHA_MASK #ifdef ALPHA_MASK
if(fragmentColor.a < alphaMask) discard; /* Using <= because if mask is set to 1.0, it should discard all, similarly
as when using 0, it should only discard what's already invisible
anyway. */
if(fragmentColor.a <= alphaMask) discard;
#endif #endif
} }

5
src/Magnum/Shaders/Phong.frag

@ -187,6 +187,9 @@ void main() {
} }
#ifdef ALPHA_MASK #ifdef ALPHA_MASK
if(color.a < alphaMask) discard; /* Using <= because if mask is set to 1.0, it should discard all, similarly
as when using 0, it should only discard what's already invisible
anyway. */
if(color.a <= alphaMask) discard;
#endif #endif
} }

Loading…
Cancel
Save