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

Set gl.clearColor to transparent for render-to-texture nodes #421

Merged
merged 1 commit into from
Oct 29, 2024

Conversation

erikhaandrikman
Copy link
Contributor

Issue: When rendering parts on the render tree to a texture ( RTT ) and the clearColor is set to a solid color rather than being transparent, this color is used to clear the colorbuffer of the texture's framebuffer. This results in render textures displaying a solid background color instead of being transparent.

This PR addresses this issues by setting the gl.clearColor to transparent before the render to texture pass begins and restoring it when the pass is complete.

Before:

before

After:

after

Copy link
Contributor

@wouterlucas wouterlucas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@wouterlucas wouterlucas added this pull request to the merge queue Oct 29, 2024
Merged via the queue into main with commit f7def82 Oct 29, 2024
2 checks passed
@wouterlucas wouterlucas mentioned this pull request Nov 4, 2024
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

Successfully merging this pull request may close these issues.

2 participants