Screenshots from any render target not just windows #12478
Labels
A-Rendering
Drawing game state to the screen
C-Feature
A new feature, making something new possible
D-Straightforward
Simple bug fixes and API improvements, docs, test and examples
X-Uncontroversial
This work is generally agreed upon
What problem does this solve or what need does it fill?
Example use cases:
What solution would you like?
Allow taking screenshots of any render target: http://dev-docs.bevyengine.org/bevy/render/camera/enum.RenderTarget.html
What alternative(s) have you considered?
Additional context
Just initial thoughts on how it might work
From a quick look it seems that currently extracted windows have a special field: https://github.com/bevyengine/bevy/blob/main/crates/bevy_render/src/view/window/mod.rs#L73
pub screenshot_memory: Option<ScreenshotPreparedState>
it seems to me that this shouldn't be necessary- perhaps a solution where something like
could be considered, and cameras (and windows?) with this component can have their screenshots taken.
This would also allow things like
There might be a loss of ergonomics if a user wants to take a screenshot of a window since they would have to add the
ScreenshotTarget
to the window entity (or entities), but an alternative could be to have windows spawn with this by default and rather have it opt-out.The text was updated successfully, but these errors were encountered: