manim icon indicating copy to clipboard operation
manim copied to clipboard

Opengl Polygram Corners Issue

Open k4pran opened this issue 2 years ago • 1 comments

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
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

Opengl Render

PolygramExample_ManimCE_v0 15 2

Opengl Render Wireframe (with blending disabled)

PolygramExample_ManimCE_v0 15 2

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

k4pran avatar Jul 05 '22 20:07 k4pran

Yep because we do not have a polyline shader. So we are not able to choose between the different cap modes that are normally supported in cairo. Instead we just get seperate bezier curves forming a shape.

MrDiver avatar Jul 06 '22 00:07 MrDiver