ManimCommunity / ManimCommunity/manim

Weird triangulation on Text rendered with OpenGL

Open
#4,483 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

I made a mistake when creating the issue and did not follow the template on the first post. I updated the info https://github.com/ManimCommunity/manim/issues/4483#issuecomment-3567211252 later.

---

When i render the `Title` component with Cairo, i have no problems. However, while trying to replicate the same text in OpenGL, i get some weird text, more specifically, the letter 'O'.

First printscreen: preview quality, `fill_opacity=1.0`:

Image

Looking closely, it is possible to see that the 'O' character in OpenGL has some weird edges along the top.

I figured maybe the quality was what was causing it, so here is the same behavior with 4K quality:

Image

To make what i am trying to say more explicit, the edges are highlited when i set `fill_opacity=0.25`:

Image

---

I am investigating this to try and find the cause. I don't know if this is a specific of my install (in a previous PR, a mismatch on the mapbox_earcut caused a bug on my PC) or maybe something related on how OpenGL is implemented for text rendering (had no problems with other components).

I would very much appreciate anyone who has any input on this

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading the later issue comment linked in the body and reproducing the Title component with Cairo and OpenGL at the reported qualities and fill opacity. Trace the OpenGL text triangulation path, including the possible mapbox_earcut installation mismatch; the issue is done when the O renders without the reported edge artifacts and the behavior is covered by a regression test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
computer-graphics
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.