ManimCommunity / ManimCommunity/manim

OpenGL Bug for small elements rendering too big

Open
#3,320 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

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

Description

## Description of bug / unexpected behavior

I do not know why this happens by now but it must probably be some error in the shader somewhere i kind of suspect that it is the anti aliasing which breaks that part because it doesn't scale with the objects? But that might also be a red hairing so please do your own research on why this might be happeing

## Expected behavior

1080p Renderings

### Rendered with OpenGL
![Test2_ManimCE_v0 17 3](https://github.com/ManimCommunity/manim/assets/17803932/aaa39961-4909-4537-a999-23e4afb4f30b)

### Rendered with OpenGL AntiAliasing kind of removed

![Test2_ManimCE_v0 17 3](https://github.com/ManimCommunity/manim/assets/17803932/2bc2f338-f00e-4ff8-8eae-6bf10ae2bfa0)

### Rendered with Cairo
![Test2_ManimCE_v0 17 3](https://github.com/ManimCommunity/manim/assets/17803932/9ef4add2-86ea-412e-84dc-9eb5686a7e07)

4k Renderings

### Rendered with OpenGL
![Opengl4k](https://github.com/ManimCommunity/manim/assets/17803932/83bf7713-c855-4c00-a95a-011714a8234f)

### Rendered with OpenGL AntiAliasing kind of removed
![OpenGL4kNoAlias](https://github.com/ManimCommunity/manim/assets/17803932/6ca45627-4d23-4dbd-8997-756ea2f45683)

### Rendered with Cairo
![Cairo4k](https://github.com/ManimCommunity/manim/assets/17803932/b5fbfdd6-7b65-40fb-92f4-97507beff0eb)

In those two screenshots you can clearly see that theres a problem with rendering at small size for OpenGL where everything is just a big blob of color instead of clearly defined shapes. The red points are for visualizing that problem because they should disappear at some point because they are so small.

But rendering without antialiasing is not really feasible if we want to have a good looking result so i think the Antialiasing might add a weird extra width around the shapes.

## How to reproduce the issue

```py
class SizeGlitch(MovingCameraScene):
def construct(self):
for i in range(1, 10):
text = Text(
f"20",
# font="Sans",
weight=BOLD,
use_svg_cache=True,
).shift(LEFT * 5 + RIGHT * i)
text2 = (
Text(str(0.1 / (i * 10)))
.shift(DOWN)
.scale(0.1)
.shift(LEFT * 5 + RIGHT * i)
)
text2 = Text("A").shift(UP).scale(1 / i).shift(LEFT * 5 + RIGHT * i)

dots = [
Dot(p, radius=0.1 / (i * 10), color=RED) for p in text.get_all_points()
]
self.add(text, text2, *dots)
```

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 with the SizeGlitch MovingCameraScene reproduction and compare its OpenGL output with the anti-aliasing-disabled and Cairo examples. Trace how the small Text shapes and Dot objects are rendered at 1080p and 4K. Done means small elements remain clearly defined and appropriately scaled while normal anti-aliasing remains enabled.

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
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.