ManimCommunity / ManimCommunity/manim

Opengl Polygram Corners Issue

Open
#2,860 1 comment 0 reactions 0 assignees View on GitHub
opengl
Dominant language
Python
Stars
40.9k
Forks
3.1k
Avg merge
3d 12h
Merged PRs (30d)
25

Description

## Description of bug / unexpected behavior

In opengl the polygram example shows some corners are not rendered correctly when the width is increased. This may point to an issue in the shaders.

## Expected behavior

Six even corners in the hexagon

## How to reproduce the issue

Set the renderer to opengl

Code for reproducing the problem

```py
class PolygramExample(Scene):
def construct(self):
hexagram = Polygram(
[[0, 2, 0], [-np.sqrt(3), -1, 0], [np.sqrt(3), -1, 0]],
[[-np.sqrt(3), 1, 0], [0, -2, 0], [np.sqrt(3), 1, 0]], stroke_width=20.
)
self.add(hexagram)
```

It only seems to cause an issue with two groups of vertices, rendering only one group results in a triangle with all corners connected correctly.

## Additional media files

Images/GIFs

**Cairo Render**

![PolygramExample_ManimCE_v0 15 2](https://user-images.githubusercontent.com/32387857/177408138-289a343c-5768-4e2e-b8c5-498ee8abefda.png)

**Opengl Render**

![PolygramExample_ManimCE_v0 15 2](https://user-images.githubusercontent.com/32387857/177408243-b22240cd-42b2-461b-bfab-a5043ad407ea.png)

**Opengl Render Wireframe (with blending disabled)**

![PolygramExample_ManimCE_v0 15 2](https://user-images.githubusercontent.com/32387857/177408399-523f1ce7-0a84-40f1-848d-e137bfddc82e.png)

## Logs
Terminal output

```
PASTE HERE OR PROVIDE LINK TO https://pastebin.com/ OR SIMILAR
```

## System specifications

System Details

- OS (with version, e.g., Windows 10 v2004 or macOS 10.15 (Catalina)):
- RAM:
- Python version (`python/py/python3 --version`):
- Installed modules (provide output from `pip list`):
```
PASTE HERE
```

LaTeX details

+ LaTeX distribution (e.g. TeX Live 2020):
+ Installed LaTeX packages:

FFMPEG

Output of `ffmpeg -version`:

```
PASTE HERE
```

## Additional comments

Contributor guide

Open the contributing guide

Research direction

Start with the PolygramExample reproduction and run it using the OpenGL renderer, comparing the result with the Cairo and wireframe renders shown in the issue. Inspect the OpenGL shader path involved in Polygram rendering, especially with both vertex groups and increased stroke width. Done means the hexagram displays six even corners like the expected result.

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
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.