Skip to content
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

opengl not respecting z_index order when rendering #4070

Open
NielsKornerup opened this issue Dec 25, 2024 · 0 comments
Open

opengl not respecting z_index order when rendering #4070

NielsKornerup opened this issue Dec 25, 2024 · 0 comments

Comments

@NielsKornerup
Copy link

Description of bug / unexpected behavior

When rendering with opengl, mobjects are layered based on the order that they were added rather than the intended z_index order.

Expected behavior

Objects should be ordered according to their z_index

How to reproduce the issue

Run the below code with rendering from either either Cairo or openGL. Cairo gives you the red rectangle while openGL gives you the blue rectangle.

Code for reproducing the problem
config.background_color = WHITE
class MakeRectangles(Scene):
    def construct(self):
        rect1 = Rectangle(fill_color=BLUE, fill_opacity=1)
        rect2 = Rectangle(fill_color=RED, fill_opacity=1)
        rect2.z_index = 2
        rect1.z_index = 1
        self.add(rect2)
        self.add(rect1)

Additional media files

Images/GIFs

openGL output
Why_ManimCE_v0 18 1
Cairo output
Why_ManimCE_v0 18 1

System specifications

System Details
Python 3.12.3
Manim Community v0.18.1
LaTeX details

Additional comments

This seems to be a problem with the render function here:

https://github.com/ManimCommunity/manim/blob/dbad8a86bc6041af78d5fb7d7a07f76d9b164072/manim/scene/scene.py#L440C1-L449C14

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant