bevyengine / bevyengine/bevy

Screenshot::image() no longer works with off-screen textures not attached to a Camera's RenderTarget

Open
#25,215 0 comments 0 reactions 0 assignees View on GitHub
A-Rendering C-Bug S-Needs-Investigation
Dominant language
Rust
Stars
48.2k
Forks
4.8k
Avg merge
3d 16h
Merged PRs (30d)
171

Description

## Bevy version and features

bevy = { version = "0.19.0", default-features = false, features = [
"android-game-activity",
"async_executor",
"bevy_anti_alias",
"bevy_asset",
"bevy_camera",
"bevy_color",
"bevy_core_pipeline",
"bevy_gizmos",
"bevy_gizmos_render",
"bevy_gltf",
"bevy_image",
"bevy_input_focus",
"bevy_light",
"bevy_log",
"bevy_mesh",
"bevy_mikktspace",
"bevy_pbr",
"bevy_picking",
"bevy_post_process",
"bevy_render",
"bevy_scene",
"bevy_shader",
"bevy_state",
"bevy_text",
"bevy_ui",
"bevy_ui_render",
"bevy_window",
"bevy_winit",
"default_font",
"hdr",
"jpeg",
"ktx2",
"mesh_picking",
"multi_threaded",
"png",
"reflect_auto_register",
"std",
"sysinfo_plugin",
"tonemapping_luts",
"ui_picking",
"wayland",
"webgl2",
"x11",
"zstd_rust",
] }

## What you did

I created an off-screen texture via myself, and wrote content to it using my own rendering pipeline—without attaching it to any Camera's RenderTarget. Then I called Screenshot::image(image_handle) to save the texture content as an image file.

Previously, this workflow worked perfectly: the screenshot API would capture the current content of any valid image handle, regardless of whether it belonged to a camera's render target.

## What went wrong

Now, Screenshot::image(image_handle) no longer works for off-screen textures.

What I expected: The API to output the texture's current pixel data as an image, just like it did in earlier versions.

What actually happened: The output is blank. It seems the screenshot function now requires the image_handle to be strictly tied to a Camera's RenderTarget::Image(). To get any usable output, I have to move my rendering logic into the PostProcess stage and attach the texture to a camera.

## Additional information

Question: Is this change intentional (e.g., design decision or optimization), or is it a regression? If intentional, do you plan to restore support for off-screen textures in future releases? Or should I assume this is no longer supported and implement my own export logic?

Contributor guide

Open the contributing guide

Research direction

Start at the Screenshot::image(image_handle) entry point and reproduce the report with an off-screen texture created independently of a camera RenderTarget. Compare its output with a camera-attached RenderTarget::Image; done means the valid off-screen image's current pixels are captured rather than producing a blank result.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
computer-graphics, game-dev
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.