diff --git a/manimlib/shader_wrapper.py b/manimlib/shader_wrapper.py index b175d3ed..080bec55 100644 --- a/manimlib/shader_wrapper.py +++ b/manimlib/shader_wrapper.py @@ -372,13 +372,6 @@ class VShaderWrapper(ShaderWrapper): if self.fill_vao is None: return - # TODO, need a new test here...or to just kill non-winding fill? - winding = True - self.fill_program['winding'].value = winding - if not winding: - self.fill_vao.render() - return - original_fbo = self.ctx.fbo texture_fbo, depth_texture_fbo, texture_vao = self.fill_canvas diff --git a/manimlib/shaders/quadratic_bezier_fill/frag.glsl b/manimlib/shaders/quadratic_bezier_fill/frag.glsl index 4cfed975..313873a6 100644 --- a/manimlib/shaders/quadratic_bezier_fill/frag.glsl +++ b/manimlib/shaders/quadratic_bezier_fill/frag.glsl @@ -29,17 +29,15 @@ void main() { cap is to make sure the original fragment color can be recovered even after blending with an (alpha = 1) color. */ - if(winding){ - float a = 0.95 * frag_color.a; - if(orientation < 0) a = -a / (1 - a); - frag_color.a = a; - } + float a = 0.95 * frag_color.a; + if(orientation < 0) a = -a / (1 - a); + frag_color.a = a; if (bool(fill_all)) return; float x = uv_coords.x; float y = uv_coords.y; float Fxy = (y - x * x); - if(!winding && orientation < 0) Fxy *= -1; + // if(!winding && orientation < 0) Fxy *= -1; if(Fxy < 0) discard; } diff --git a/manimlib/shaders/quadratic_bezier_fill/geom.glsl b/manimlib/shaders/quadratic_bezier_fill/geom.glsl index a36ec732..e92038f0 100644 --- a/manimlib/shaders/quadratic_bezier_fill/geom.glsl +++ b/manimlib/shaders/quadratic_bezier_fill/geom.glsl @@ -3,8 +3,6 @@ layout (triangles) in; layout (triangle_strip, max_vertices = 6) out; -uniform bool winding; - in vec3 verts[3]; in vec4 v_color[3]; in vec3 v_base_point[3]; @@ -48,14 +46,6 @@ void emit_triangle(vec3 points[3], vec4 v_color[3]){ } -void emit_simple_triangle(){ - emit_triangle( - vec3[3](verts[0], verts[1], verts[2]), - vec4[3](v_color[0], v_color[1], v_color[2]) - ); -} - - void main(){ // Vector graphic shaders use TRIANGLE_STRIP, but only // every other one needs to be rendered @@ -68,25 +58,17 @@ void main(){ // Check zero fill if (vec3(v_color[0].a, v_color[1].a, v_color[2].a) == vec3(0.0, 0.0, 0.0)) return; - - if(winding){ - // Emit main triangle - fill_all = 1.0; - emit_triangle( - vec3[3](v_base_point[0], verts[0], verts[2]), - vec4[3](v_color[1], v_color[0], v_color[2]) - ); - // Edge triangle - fill_all = 0.0; - emit_simple_triangle(); - }else{ - // In this case, one should fill all if the vertices are - // not in sequential order - fill_all = float( - (v_vert_index[1] - v_vert_index[0]) != 1.0 || - (v_vert_index[2] - v_vert_index[1]) != 1.0 - ); - emit_simple_triangle(); - } + // Emit main triangle + fill_all = 1.0; + emit_triangle( + vec3[3](v_base_point[0], verts[0], verts[2]), + vec4[3](v_color[1], v_color[0], v_color[2]) + ); + // Edge triangle + fill_all = 0.0; + emit_triangle( + vec3[3](verts[0], verts[1], verts[2]), + vec4[3](v_color[0], v_color[1], v_color[2]) + ); }