From 4cb16dfc0b76d2287f73f4d0287cc9635d61c6e8 Mon Sep 17 00:00:00 2001 From: Grant Sanderson Date: Mon, 19 Aug 2024 11:28:58 -0500 Subject: [PATCH] Don't apply depth test during winding fill --- manimlib/shader_wrapper.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/manimlib/shader_wrapper.py b/manimlib/shader_wrapper.py index 02373ea0..49f9782e 100644 --- a/manimlib/shader_wrapper.py +++ b/manimlib/shader_wrapper.py @@ -378,7 +378,13 @@ class VShaderWrapper(ShaderWrapper): gl.GL_ONE_MINUS_DST_ALPHA, gl.GL_ONE, ) + # Be sure not to apply depth test while rendering fill + # but set it back to where it was after + apply_depth_test = bool(gl.glGetBooleanv(gl.GL_DEPTH_TEST)) + self.ctx.disable(moderngl.DEPTH_TEST) self.fill_vao.render() + if apply_depth_test: + self.ctx.enable(moderngl.DEPTH_TEST) original_fbo.use() gl.glBlendFunc(gl.GL_ONE, gl.GL_ONE_MINUS_SRC_ALPHA)