ManimCommunity / manim

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

Issue rendering lines with OpenGL renderer #3335

Open atzlt opened 1 year ago

atzlt commented 1 year ago

Description of bug / unexpected behavior

Whenever I tried to render a straight line with OpenGL renderer (in ThreeDScene, if this is relevant), it fails to appear.

Expected behavior

Lines should appear.

How to reproduce the issue

Minimal example:

# main.py
from manim import *

class ExampleScene(ThreeDScene):
    def construct(self):
        self.add(Line())
        self.wait()

Render with manim render main.py --renderer opengl --write_to_file. The resulting movie is empty.

Logs

Terminal output ``` $ manim render main.py --renderer opengl --write_to_movie -v debug Manim Community v0.17.3 [08/18/23 22:25:26] DEBUG Animation with empty mobject animation.py:174 DEBUG Hashing ... hashing.py:350 DEBUG Hashing done in 0.008119 s. hashing.py:362 DEBUG Hash generated : 2465576764_2828545558_228940957 hashing.py:365 DEBUG List of the first few animation hashes of the scene: ['2465576764_2828545558_228940957'] caching.py:61 DEBUG C:\Users\hp\scoop\apps\python\current\Lib\site-packages\manim\renderer\shaders\vert.gls shader_wrapper.py:32 l does not exist. DEBUG \vert.glsl does not exist. shader_wrapper.py:32 DEBUG C:\Users\hp\scoop\apps\python\current\Lib\site-packages\manim\renderer\shaders\geom.gls shader_wrapper.py:32 l does not exist. DEBUG \geom.glsl does not exist. shader_wrapper.py:32 DEBUG C:\Users\hp\scoop\apps\python\current\Lib\site-packages\manim\renderer\shaders\frag.gls shader_wrapper.py:32 l does not exist. DEBUG \frag.glsl does not exist. shader_wrapper.py:32 [08/18/23 22:25:27] INFO Animation 0 : Partial movie file written in scene_file_writer.py:527 '\media\videos\main\1080p60\partial_movie_fi les\ExampleScene\2465576764_2828545558_228940957.mp4' INFO Combining to Movie file. scene_file_writer.py:617 DEBUG Partial movie files to combine (1 files): scene_file_writer.py:561 ['E:\\CodePro\\Animations\\manim\\art-gallery\\media\\videos\\main\\1080p60\\partia l_movie_files\\ExampleScene\\2465576764_2828545558_228940957.mp4'] INFO scene_file_writer.py:736 File ready at 'E:\CodePro\Animations\manim\art-gallery\media\videos\main\1080p60\ExampleScene.mp4 ' INFO Rendered ExampleScene scene.py:241 Played 1 animations ```

System specifications

System Details - OS: Windows 10 - RAM: 16GB - Python version (`python/py/python3 --version`): Python 3.11.1
FFMPEG Output of `ffmpeg -version`: ``` ffmpeg version 5.0-essentials_build-www.gyan.dev Copyright (c) 2000-2022 the FFmpeg developers built with gcc 11.2.0 (Rev5, Built by MSYS2 project) configuration: --enable-gpl --enable-version3 --enable-static --disable-w32threads --disable-autodetect --enable-fontconfig --enable-iconv --enable-gnutls --enable-libxml2 --enable-gmp --enable-lzma --enable-zlib --enable-libsrt --enable-libssh --enable-libzmq --enable-avisynth --enable-sdl2 --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxvid --enable-libaom --enable-libopenjpeg --enable-libvpx --enable-libass --enable-libfreetype --enable-libfribidi --enable-libvidstab --enable-libvmaf --enable-libzimg --enable-amf --enable-cuda-llvm --enable-cuvid --enable-ffnvcodec --enable-nvdec --enable-nvenc --enable-d3d11va --enable-dxva2 --enable-libmfx --enable-libgme --enable-libopenmpt --enable-libopencore-amrwb --enable-libmp3lame --enable-libtheora --enable-libvo-amrwbenc --enable-libgsm --enable-libopencore-amrnb --enable-libopus --enable-libspeex --enable-libvorbis --enable-librubberband libavutil 57. 17.100 / 57. 17.100 libavcodec 59. 18.100 / 59. 18.100 libavformat 59. 16.100 / 59. 16.100 libavdevice 59. 4.100 / 59. 4.100 libavfilter 8. 24.100 / 8. 24.100 libswscale 6. 4.100 / 6. 4.100 libswresample 4. 3.100 / 4. 3.100 libpostproc 56. 3.100 / 56. 3.100 ```
uwezi commented 1 year ago

can you try the following code:

from manim import *
from manim.opengl import *

class ExampleScene(ThreeDScene):
    def construct(self):
        self.add(Line())
        self.wait()        
atzlt commented 1 year ago

No, it doesn't work. The scene is still empty.

atzlt commented 1 year ago

This problem is serious enough to break my workflow. I hope there is someone investigating it. I would provide as much information as I can. (By the way filling objects works fine. Only strokes are not shown. Also if I use cairo renderer everything renders correctly.)

vaclavblazej commented 1 year ago

Hi. I was unable to reproduce the issue. Do you use some custom configuration?

Source code ```py # main.py from manim import * class ExampleScene(ThreeDScene): def construct(self): self.add(Line()) self.wait() ```
Build output ``` $ manim render main.py --renderer opengl --write_to_movie -p -v debug Manim Community v0.17.3 [08/22/23 17:51:54] DEBUG Animation with empty mobject animation.py:174 DEBUG Hashing ... hashing.py:350 DEBUG Hashing done in 0.008371 s. hashing.py:362 DEBUG Hash generated : 233493676_3146877161_3043888565 hashing.py:365 DEBUG List of the first few animation hashes of the scene: ['233493676_3146877161_3043888565'] caching.py:61 DEBUG /home/u2271725/Documents/Projects/manim/manim/renderer/shaders/vert.glsl does not exist. shader_wrapper.py:32 DEBUG /vert.glsl does not exist. shader_wrapper.py:32 DEBUG /home/u2271725/Documents/Projects/manim/manim/renderer/shaders/geom.glsl does not exist. shader_wrapper.py:32 DEBUG /geom.glsl does not exist. shader_wrapper.py:32 DEBUG /home/u2271725/Documents/Projects/manim/manim/renderer/shaders/frag.glsl does not exist. shader_wrapper.py:32 DEBUG /frag.glsl does not exist. shader_wrapper.py:32 [08/22/23 17:51:55] INFO Animation 0 : Partial movie file written in scene_file_writer.py:527 '/home/u2271725/Documents/Projects/manim/media/videos/main/1080p60/partial_movie_files/ExampleScene/23349 3676_3146877161_3043888565.mp4' INFO Combining to Movie file. scene_file_writer.py:617 DEBUG Partial movie files to combine (1 files): scene_file_writer.py:561 ['/home/u2271725/Documents/Projects/manim/media/videos/main/1080p60/partial_movie_files/ExampleScene/2334 93676_3146877161_3043888565.mp4'] INFO scene_file_writer.py:735 File ready at '/home/u2271725/Documents/Projects/manim/media/videos/main/1080p60/ExampleScene.mp4' INFO Rendered ExampleScene scene.py:241 Played 1 animations INFO Previewed File at: '/home/u2271725/Documents/Projects/manim/media/videos/main/1080p60/ExampleScene.mp4' file_ops.py:227 ```
Rendered output https://github.com/ManimCommunity/manim/assets/6208643/c8e8e138-5b6a-4c78-84ee-afb37c1bfe20
ffmpeg version 5.1.2-3ubuntu1 Copyright (c) 2000-2022 the FFmpeg developers
built with gcc 12 (Ubuntu 12.2.0-14ubuntu2)
configuration: --prefix=/usr --extra-version=3ubuntu1 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libglslang --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librist --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzimg --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --disable-sndio --enable-libjxl --enable-pocketsphinx --enable-librsvg --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-libplacebo --enable-librav1e --enable-shared
libavutil      57. 28.100 / 57. 28.100
libavcodec     59. 37.100 / 59. 37.100
libavformat    59. 27.100 / 59. 27.100
libavdevice    59.  7.100 / 59.  7.100
libavfilter     8. 44.100 /  8. 44.100
libswscale      6.  7.100 /  6.  7.100
libswresample   4.  7.100 /  4.  7.100
libpostproc    56.  6.100 / 56.  6.100
vaclavblazej commented 1 year ago

Does the issue persist if you use Scene and remove wait?

uwezi commented 1 year ago

This problem is serious enough to break my workflow. I hope there is someone investigating it. I would provide as much information as I can. (By the way filling objects works fine. Only strokes are not shown. Also if I use cairo renderer everything renders correctly.)

Does this problem persist for very thick lines, such as stroke_width=10 ?

atzlt commented 1 year ago
from manim import *
from manim.opengl import *

class Intro(Scene):
    def construct(self):
        self.add(Line(stroke_width=10))
        self.wait()

Still empty. Is that an issue with my OpenGL?

Does the issue persist if you use Scene and remove wait?

I'm not sure how I can see the output without a wait. Could you tell me the details?