diff --git a/manimlib/shader_wrapper.py b/manimlib/shader_wrapper.py index 3de2612b..da657bdd 100644 --- a/manimlib/shader_wrapper.py +++ b/manimlib/shader_wrapper.py @@ -446,6 +446,11 @@ class VShaderWrapper(ShaderWrapper): color = texture(Texture, uv); if(color.a == 0) discard; + if(color.a < 0){ + color.a = -color.a / (1.0 - color.a); + color.rgb *= (color.a - 1); + } + // Counteract scaling in fill frag color *= 1.06; diff --git a/manimlib/shaders/textured_surface/frag.glsl b/manimlib/shaders/textured_surface/frag.glsl index cb5f061c..de859c16 100644 --- a/manimlib/shaders/textured_surface/frag.glsl +++ b/manimlib/shaders/textured_surface/frag.glsl @@ -26,6 +26,7 @@ void main() { float alpha = smoothstep(-dark_shift, dark_shift, dp); color = mix(dark_color, color, alpha); } + if (color.a == 0) discard; frag_color = finalize_color( color, diff --git a/requirements.txt b/requirements.txt index 5f1eab8c..0737d3fc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -2,7 +2,7 @@ colour ipython>=8.18.0 isosurfaces fontTools -manimpango>=0.4.0.post0,<0.5.0 +manimpango>=0.6.0 mapbox-earcut matplotlib moderngl