mirror of
https://github.com/3b1b/manim.git
synced 2025-11-14 05:27:44 +00:00
Discard frag shader outside dot radius
This commit is contained in:
parent
2d709758d0
commit
bfa36a7659
1 changed files with 4 additions and 1 deletions
|
|
@ -17,8 +17,11 @@ out vec4 frag_color;
|
|||
void main() {
|
||||
vec2 diff = point - center;
|
||||
float dist = length(diff);
|
||||
vec3 normal = vec3(diff / radius, sqrt(1 - (dist * dist) / (radius * radius)));
|
||||
float signed_dist = dist - radius;
|
||||
if (signed_dist > 0.5 * anti_alias_width){
|
||||
discard;
|
||||
}
|
||||
vec3 normal = vec3(diff / radius, sqrt(1 - (dist * dist) / (radius * radius)));
|
||||
frag_color = add_light(
|
||||
color,
|
||||
vec3(point.xy, 0.0),
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue