ManimCommunity / manim

A community-maintained Python framework for creating mathematical animations.
https://www.manim.community
MIT License
26.7k stars 1.83k forks source link

Opengl Text Rendering in A Strange Way #3939

Closed BenRaz123 closed 3 weeks ago

BenRaz123 commented 2 months ago

Description of bug / unexpected behavior

When I add text to an opengl scene, it renders in an objectively strange and incorrect way.

Expected behavior

I expected normal looking text to appear

How to reproduce the issue

Code for reproducing the problem ```py from manim import * class Example(Scene): def construct(self): self.play(Write(Text("Hello World"))) ``` Command: `manim -pqm .py Example --renderer opengl`

Additional media files

Images/GIFs (Screenshot) ![broken_text](https://github.com/user-attachments/assets/ce53db2c-9c92-44ce-b2b7-25f57d2002e4)

Logs

Terminal output ``` Manim Community v0.18.1 [09/23/24 17:43:20] DEBUG Hashing ... hashing.py:350 DEBUG Hashing done in 0.041313 s. hashing.py:362 DEBUG Hash generated : 233493676_694719346_223132457 hashing.py:365 DEBUG List of the first few animation hashes of the scene: ['233493676_694719346_223132457'] caching.py:61 [09/23/24 17:43:21] INFO Rendered MyClass scene.py:241 Played 1 animations ```

System specifications

System Details - OS: Fedora Asahi Remix release 39 - RAM: 15967568 kB - Python version: 3.12.5 - Installed modules (provide output from `pip list`): ``` Package Version ----------------------- ------------ anyio 4.4.0 appdirs 1.4.4 apsw 3.42.0.1 argcomplete 2.0.0 asahi-firmware 0.1 asciidoc 10.2.0 asn1 2.7.0 asttokens 2.4.1 backcall 0.2.0 Beaker 1.12.1 beautifulsoup4 4.12.3 black 24.8.0 blivet 3.8.2 Brlapi 0.8.5 Brotli 1.1.0 cairocffi 1.7.1 certifi 2023.5.7 cffi 1.15.1 chardet 5.2.0 charset-normalizer 3.3.2 click 8.1.3 click-default-group 1.2.4 click-plugins 1.1.1 cloup 2.1.2 colorama 0.4.6 colour 0.1.5 commonmark 0.9.1 conda 23.9.0 conda-package-handling 2.1.0 conda_package_streaming 0.7.0 cryptography 41.0.7 cson 0.8 css-parser 1.0.7 cssselect 1.1.0 cssselect2 0.7.0 cupshelpers 1.0 Cython 3.0.6 dasbus 1.7 dbus-next 0.2.3 dbus-python 1.3.2 decorator 5.1.1 defusedxml 0.7.1 diskcache 5.6.3 distro 1.8.0 dnf 4.21.1 dnspython 2.6.1 executing 2.1.0 fastcore 1.7.1 fastlite 0.0.9 fb-re2 1.0.7 fedora-third-party 0.10 feedparser 6.0.11 file-magic 0.4.0 filelock 3.15.4 fonttools 4.43.1 fros 1.1 frozendict 2.3.8 fs 2.4.16 fsspec 2024.6.1 glcontext 2.5.0 h11 0.14.0 html2text 2020.1.16 html5-parser 0.4.10 html5lib 1.1 httpcore 1.0.5 httptools 0.6.1 httpx 0.27.2 huggingface-hub 0.24.6 humanize 3.13.1 i3ipc 2.2.1 idna 3.7 ifaddr 0.1.7 initial-setup 0.3.98 inkex 1.3.1 ipython 8.0.1 isosurfaces 0.1.0 itsdangerous 2.2.0 jedi 0.19.1 jeepney 0.8.0 Jinja2 3.1.4 jsonpatch 1.33 jsonpointer 2.3 keyboard 0.13.5 langtable 0.0.68 libcomps 0.1.20 libdnf 0.73.3 llama_cpp_python 0.2.89 lxml 4.9.3 Mako 1.2.3 manim 0.18.1 ManimPango 0.5.0 mapbox_earcut 1.0.1 Markdown 3.5.2 markdown-it-py 3.0.0 MarkupSafe 2.1.3 matplotlib-inline 0.1.7 mdurl 0.1.2 mechanize 0.4.8 mercurial 6.5.3 meson 1.3.2 moderngl 5.10.0 moderngl-window 2.4.4 msgpack 1.0.5 multipledispatch 1.0.0 mutagen 1.46.0 mypy-extensions 1.0.0 netifaces 0.11.0 networkx 3.2.1 nftables 0.1 numexpr 2.8.5 numpy 1.26.4 nwg-panel 0.9.35 oauthlib 3.2.2 odfpy 1.4.1 olefile 0.46 packaging 23.1 pangocairocffi 0.4.0 pangocffi 0.8.0 parso 0.8.4 Paste 3.5.3 pathspec 0.12.1 pexpect 4.8.0 pickleshare 0.7.5 pid 2.2.3 Pillow 9.5.0 pip 23.2.1 platformdirs 3.9.1 pluggy 1.2.0 ply 3.11 pooch 1.8.2 productmd 1.38 progressbar 2.5 prompt_toolkit 3.0.47 psutil 5.9.5 ptyprocess 0.7.0 pure_eval 0.2.3 pwquality 1.4.5 py-cpuinfo 9.0.0 pycairo 1.25.1 pychm 0.8.6 pycosat 0.6.4 pycparser 2.20 pycrypto 2.6.1 pycryptodomex 3.20.0 pycups 2.0.4 pycurl 7.45.2 pydub 0.25.1 pydyf 0.8.0 pyenchant 3.2.2 pyglet 2.0.10 Pygments 2.18.0 PyGObject 3.46.0 pykickstart 3.48 PyOpenGL 3.1.7 PyOpenGL-accelerate 3.1.7 pyOpenSSL 23.2.0 pyparsing 3.0.9 pyparted 3.13.0 pyphen 0.13.2 pyproj 3.6.1 PyQt5 5.15.10 PyQt5-sip 12.13.0 PyQt6 6.6.1 PyQt6-sip 13.6.0 PyQt6-WebEngine 6.6.0 pyqtgraph 0.13.3 pyrr 0.10.3 pyserial 3.5 PySocks 1.7.1 pyte 0.8.2 python-augeas 1.1.0 python-dateutil 2.8.2 python-dotenv 1.0.1 python-fasthtml 0.4.5 python-meh 0.51 python-multipart 0.0.9 python-xlib 0.33 pyudev 0.24.1 pyxdg 0.27 PyYAML 6.0.1 qutebrowser 3.1.0 regex 2024.4.28 requests 2.28.2 requests-file 1.5.1 requests-ftp 0.3.1 rich 13.8.1 rpm 4.19.1.1 ruamel.yaml 0.17.32 ruamel.yaml.clib 0.2.7 scipy 1.12.0 scour 0.38.2 screeninfo 0.8.1 selinux 3.5 sepolicy 3.5 setools 4.4.3 setuptools 67.7.2 sgmllib3k 1.0.0 simpleaudio 1.0.4 simpleline 1.9.0 six 1.16.0 skia-pathops 0.8.0.post1 sniffio 1.3.1 sos 4.6.0 soupsieve 2.5 speg 0.3 sqlite-minutils 3.37.0.post2 srt 3.5.3 stack-data 0.6.3 starlette 0.38.2 svgelements 1.9.6 systemd-python 235 Tempita 0.5.2 tenacity 8.2.3 thefuck 3.32 thrift 0.15.0 tinycss2 1.2.1 tqdm 4.66.5 traitlets 5.14.3 typing_extensions 4.12.2 urllib3 1.26.19 uvicorn 0.30.6 uvloop 0.20.0 watchdog 3.0.0 watchfiles 0.23.0 wcwidth 0.2.5 weasyprint 60.2 webencodings 0.5.1 websockets 11.0.3 wikipedia 1.4.0 wikipedia-cli 1.0.3 xxhash 3.5.0 youtube-dl 2021.12.17 yt-dlp 2024.8.6 zeroconf 0.118.0 zombie-imp 0.0.2 zopfli 0.2.2 zstandard 0.21.0 ```
LaTeX details + LaTeX distribution (e.g. TeX Live 2020): TeX Live 2023/Fedora 39 + Installed LaTeX packages:

Additional comments

Using SwaymWM + Wayland and XWayland is usually very bad quality for me

mdhvg commented 1 month ago

I tried running the provided code on Gnome with X11 and I couldn't reproduct the issue. image

And this was the terminal output

Manim Community v0.18.1

[10/17/24 11:14:24] DEBUG    Hashing ...                                                                                                                                               hashing.py:352
                    DEBUG    Hashing done in 0.070716 s.                                                                                                                               hashing.py:364
                    DEBUG    Hash generated :  3123472686_234191481_223132457                                                                                                          hashing.py:367
                    DEBUG    List of the first few animation hashes of the scene: ['3123472686_234191481_223132457']                                                                    caching.py:62
[10/17/24 11:14:25] INFO     Rendered Example                                                                                                                                            scene.py:248
                             Played 1 animations
BenRaz123 commented 1 month ago

Thanks for looking at my issue! I had the original problem while using Wayland, not X11. Specifically, I was using a wlroots-based window manager.

notdevcody commented 1 month ago

Perhaps an Asahi issue? Do any other OpenGL programs have issues?

BenRaz123 commented 3 weeks ago

I could not reproduce the issue, I guess that means the problem is solved.