Skip to content

Skewed output when changing resolution of new headless_renderer example #13384

Closed
@cxreiff

Description

@cxreiff

Bevy version

main
v0.14.0-dev
f91fd32

Relevant system information

rustc/cargo 1.78.0

`SystemInfo { os: "MacOS 14.4.1 ", kernel: "23.4.0", cpu: "Apple M2 Max", core_count: "12", memory: "96.0 GiB" }`
`AdapterInfo { name: "Apple M2 Max", vendor: 0, device: 0, device_type: IntegratedGpu, driver: "", driver_info: "", backend: Metal }`

What you did

Hello all - I am taking a look at the new headless_renderer example in the repo: https://github.com/bevyengine/bevy/blob/main/examples/app/headless_renderer.rs
#13006

I have a use case where I would need to set the dimensions of the output image based on something outside of bevy. So I ran the example after changing the configured dimensions (on line 69 in the AppConfig struct).

What went wrong

I expected the output image to be properly formatted at the indicated resolution. However, just changing the width by 1 or a few results in output that is skewed/misaligned (examples attached).

I sort of suspected that this had to do with bevy's default output, which doesn't match the resolution in the example but does have the same aspect ratio. So I changed the primary_window in WindowPlugin from None to a window with the config-defined dimensions:

primary_window: Some(Window {
  resolution: WindowResolution::new(config.width as f32, config.height as f32),
  ..default()
}),

...but it didn't change the output at all (and in fact no window appears, I assume because the camera's target is still set to a texture).

Additional information

I assume its most likely some kind of bit alignment issue where the resolution needs to be a certain aspect ratio or along certain increments, but I tried changing the width by increments of 4, 8, etc, and had no luck.

Thank you.

001
000

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-BugAn unexpected or incorrect behaviorS-Needs-TriageThis issue needs to be labelled

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions