diff --git a/manimlib/shaders/true_dot/frag.glsl b/manimlib/shaders/true_dot/frag.glsl index eca8b0b1..fe590657 100644 --- a/manimlib/shaders/true_dot/frag.glsl +++ b/manimlib/shaders/true_dot/frag.glsl @@ -13,6 +13,7 @@ in vec4 color; in float radius; in vec2 center; in vec2 point; +in float scaled_aaw; out vec4 frag_color; @@ -22,7 +23,7 @@ void main() { vec2 diff = point - center; float dist = length(diff); float signed_dist = dist - radius; - if (signed_dist > 0.5 * anti_alias_width){ + if (signed_dist > 0.5 * scaled_aaw){ discard; } frag_color = color; @@ -43,5 +44,5 @@ void main() { frag_color.a *= pow(1 - dist / radius, glow_factor); } - frag_color.a *= smoothstep(0.5, -0.5, signed_dist / anti_alias_width); + frag_color.a *= smoothstep(0.5, -0.5, signed_dist / scaled_aaw); } \ No newline at end of file diff --git a/manimlib/shaders/true_dot/geom.glsl b/manimlib/shaders/true_dot/geom.glsl index 2a652a35..11e2d3bb 100644 --- a/manimlib/shaders/true_dot/geom.glsl +++ b/manimlib/shaders/true_dot/geom.glsl @@ -5,6 +5,7 @@ layout (triangle_strip, max_vertices = 4) out; // Needed for get_gl_Position uniform vec2 frame_shape; +uniform vec2 pixel_shape; uniform float focal_distance; uniform float is_fixed_in_frame; uniform float anti_alias_width; @@ -17,6 +18,7 @@ out vec4 color; out float radius; out vec2 center; out vec2 point; +out float scaled_aaw; #INSERT get_gl_Position.glsl @@ -25,8 +27,9 @@ void main() { radius = v_radius[0]; center = v_point[0].xy; + scaled_aaw = (frame_shape.y / pixel_shape.y); radius = v_radius[0] / max(1.0 - v_point[0].z / focal_distance / frame_shape.y, 0.0); - float rpa = radius + anti_alias_width; + float rpa = radius + scaled_aaw; for(int i = 0; i < 4; i++){ // To account for perspective