-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Add :class:~.OpenGLImageMobject
#1837
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will fix it, the reason for this is because we're using a VAO and not an EBO. So when it's rendering triangles with the VBO, it uses coordinates 0,1,2 and then 3,4,5 to do two separate triangles. We could use an EBO and not have redudant vertices by specifying only 4 vertices (as you have now) and then selecting vertices, 0,1,2 and 1,2,3 -- but that would involve changing more lines of code.
Co-authored-by: Jason Villanueva <a@jsonvillanueva.com>
With the most recent commit, a full square is rendered, although there are multiple issues I noticed (seems to be at the border of the original half-rendered triangle).
a.mp4
[mov,mp4,m4a,3gp,3g2,mj2 @ 0000022f4f3272c0] moov atom not found
[concat @ 0000022f4f31de80] Impossible to open 'file:C:/Users/laith/Documents/GitHub/hydro_manim/media/videos/mkt/1080p60/partial_movie_files/a/1491410813_1875215358_2043878721.mp4'
C:\Users\laith\Documents\GitHub\hydro_manim\media\videos\mkt\1080p60\partial_movie_files\a\partial_movie_file_list.txt: Invalid data found when processing input 2.1. However, when opacity is set to not be the default value of 1, (i.e. 0.99), it renders properly with 2.2. Also, the scene is written to movie normally regardless of opacity if
|
This is because the width/height setters have a
I'm not exactly sure why this is happening, but my intial guesses are that it's an issue with the vertex shader and the calculations from the line |
So I would not recommend merging this because this commit modifies a shader that is used by pretty much every Mobject (
This code should not have the weird warping issue -- BUT it will have other weird issues as a side-effect. We should be using model/view/projection matrices as uniforms within the shaders instead of this perspective_scale_factor magic. In reality, this may mean doing some other refactors first in order to properly have ImageMobjects in ManimCE. I'm not sure if ManimGL has working ImageMobjects; if so, their shader pipeline is probably different... but I would recommend fixing this after ManimCE properly uses MVP matrices. |
I think this is already merged with #2534 closing this PR. Feel free to reopen if this is not the case |
Changelog / Overview
Motivation
Make ImageMobject use opengl shaders.
Explanation for Changes
Ported over some code from manimgl with some adjustment to make it manimce-compatible.
Also brought over a bugfix for transparent background from manimgl to the image shader: commit here
Doesn't work, only half of the png is rendered, and when zooming in some more weird behaviour with the movement of the image is observed:
becomes:
via
Documentation Reference
N/A
Testing Status
Further Comments
Checklist
Reviewer Checklist