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

Is render_to_texture without clearing possible? Bug? #893

Open
dumski opened this issue Oct 23, 2022 · 3 comments
Open

Is render_to_texture without clearing possible? Bug? #893

dumski opened this issue Oct 23, 2022 · 3 comments

Comments

@dumski
Copy link

dumski commented Oct 23, 2022

Hi, I tried to render drawings to texture (not to window) using code from example draw_capture_hi_res.rs - but I need to render another frame on top of previous frame (with no clearing). It is perfectly possible to do this in main draw function (just if you remove the draw.background() call you can render frames without clearing).

I thought it should be possible with rendering to texture but it results with black texture no matter what... Even some other shapes drawn
in main window on top of that faulty texture becomes black.

You can reproduce the problem by commenting out line 103 of draw_capture_hi_res.rs example and you will get transparent output images instead of rendered drawings.

Is it a bug or I can achieve needed behaviour another way? Thanks!

@dumski dumski changed the title Is render_to_texture with no background possible? Bug? Is render_to_texture without clearing possible? Bug? Oct 24, 2022
@dumski
Copy link
Author

dumski commented Nov 14, 2022

Hello, anyone here? ;)

@danwilhelm
Copy link
Contributor

danwilhelm commented Nov 14, 2022

Perhaps your blend mode isn't set -- do you have a code sample? Commenting out line 103 is a different situation since it's the main framebuffer and is hardcoded to not be cleared.

@danwilhelm
Copy link
Contributor

Perhaps you can try not having a draw.background() for the main framebuffer. Then for the texture, ensure it is cleared with a transparent alpha channel and drawn with an appropriate blend mode.

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

2 participants