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

Transparent background impossible with OpenGL renderer #4079

Open
Implosiv3 opened this issue Dec 30, 2024 · 0 comments
Open

Transparent background impossible with OpenGL renderer #4079

Implosiv3 opened this issue Dec 30, 2024 · 0 comments

Comments

@Implosiv3
Copy link

Description of bug / unexpected behavior

When you try to export a video with the --transparent flag and the opengl renderer, the output video doesn't have any alpha channel.

Expected behavior

Rendered video should have transparency (alpha channel).

How to reproduce the issue

Use a ThreeDScene or Scene (the problem is the renderer, not the scene) with some OpenGLRectangle (or OpenGLMobject you want), set the self.camera.background_opacity = 0 and use the --renderer opengl and the -t tags/flags.

Additional comments

If you check the opengl_renderer.py file, that is the specific renderer that takes part when you send that flag, you can see in the line 596 that the background color is forced to have 1.0 as alpha background. This means that the background will never be transparent. That alpha value should check if the flag --transparent is set as True, as the cairo_renderer.py does, or at least allow you changing that value.

Even in the update_frame method of that file, if you manually force the background_color to be (0, 0, 0, 0) as a numpy array, it is set as 1.0 for the alpha as the setter is forcing it.

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