-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
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
Frame capture testing tool #5550
Conversation
Cool! I'll give this a review another time, but just wanted to note an initial thought: it would probably be good to integrate into |
Very cool! This is a great resource. I used some of this code to build a plugin for exporting image sequences out of Bevy: https://github.com/paulkre/bevy_image_export Unfortunately, it doesn't work with the 2D pipeline yet (2D shapes are invisible in the output image). Using a |
Apparently, a 2D camera does not work properly if it is parented to another 2D camera. I could not find the source of the problem though. |
I have been trying this out, and I think that as it is written it only works correctly for images which have a width of a multiple of It seems that two different bevy/tools/frame_capture/src/image_copy.rs Lines 87 to 88 in 0aa4a49
bevy/tools/frame_capture/src/image_copy.rs Lines 150 to 153 in 0aa4a49
Changing the first one to: let padded_bytes_per_row =
RenderDevice::align_copy_bytes_per_row((size.width) as usize * 4); produces the same padded_bytes_per_row in both situations and produces the correct image regardless of width. |
@AlanRace Good catch! I need to figure out how to make it not depend on there being 4 color channels though. Will probably reference https://github.com/gfx-rs/wgpu/blob/c434b94ca20e9ccab8b0afdd7406c595dd37e7c3/wgpu/src/util/device.rs#L112 |
@DGriffin91 Hello, I want to use your tools, but I got this error. Is there something to need before cargo run?
|
@Youdiie I'm guessing that's because this Not sure if you are aware of the new screenshot feature that landed in bevy 0.11, if you can do what you need with it, it would be probably easier than trying to use this code: https://bevyengine.org/news/bevy-0-11/#screenshot-api |
@DGriffin91 Thanks for replying! |
Objective
Solution
Image
There would be a folder of test images,
Currently
main.rs
creates a new bevy app and tests with an example scene. The.run()
returns after the test so there could be a set of scenes tested here (or elsewhere if appropriate)