3b1b / 3b1b/manim

Anti-aliasing(with vector graphics) failed with Winding Fill

Aberta
#1,999 4 comentários 0 reações 0 responsáveis Ver no GitHub
bug
Linguagem predominante
Python
Estrelas
93.9k
Forks
7.7k
Merge médio
2d 13h
PRs com merge (30d)
4

Descrição

### Description
Anti-aliasing with vector graphics seems to be not working. Though it looks acceptable on 1080x1920 rendering results, it appears bad on the preview window. Things become worse when mobjects are small(e.g. thin stroke in an 'x' character).

![image](https://user-images.githubusercontent.com/44148328/222413485-33383b17-6371-4cda-9f82-ca6a70648a30.png)

The issue seems ubiqutous among VMobject, especially among VMobject with dense points like string and tex.

### How is this caused
I checked code and I think its caused by shader code changes. Now in the fragment shader of quadratic_bezier_fill(after winding fill was introduced, I think?), it no longers uses `smoothstep` to calculate the fragment alpha for a **smooth border**, which was the mechanism in vector graphics that did the anti-aliasing. Not fragments are `discard` when `Fxy == 0` directly. I'm not sure whether this issue can be fixed, or is this intended?

### Platform
My platform information: I'm on win10, python 3.9. I didn't encounter the problem until I upgrade across the recent commits(where winding-fill was introduced and rendering was refactored into shader wrappers), and the issue exists till the latest commits available(~Feb 16) on github.

Guia de contribuição

Nenhum guia de contribuição indexado para este repositório

Direção de pesquisa

O issue aponta para o fragment shader quadratic_bezier_fill, onde o anti-aliasing via smoothstep foi substituído por uma condição discard. Comece examinando o código do shader no repositório manim, provavelmente em um diretório de shaders ou rendering. Procure commits recentes que introduzem winding fill. Teste a renderização de VMobjects pequenos para ver o aliasing. É necessário entender shaders OpenGL e renderização de gráficos vetoriais para propor uma correção.

Escrita pelo modelo de indexação a partir do texto da issue.

Avaliação

Domínio
backend, computer-graphics
Tipo de issue
Bug
Dificuldade
4/5
Tempo estimado
3-5 dias
Status de atividade
Estagnada
Clareza
Razoavelmente clara
Facilidade para iniciantes
35/100

Receba novas issues na sua caixa de entrada

Um resumo curto de issues do GitHub para quem está começando.