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

TextureAtlasBuilder::finish(), produces incorrect initial pixel byte data for texture formats with more then 1 byte per channel #2919

Closed
hamstakilla opened this issue Oct 6, 2021 · 4 comments
Labels
C-Bug An unexpected or incorrect behavior

Comments

@hamstakilla
Copy link

Bevy version

0.5.0 from crates.io

Operating system & version

Irrelevant

What you did

fn example(
    mut textures: ResMut<Assets<Texture>>,
) {
    TextureAtlasBuilder::default().format(TextureFormat::Rgba32Float).finish(&mut textures);
}

What you expected to happen

Texture Atlas texture should contain proper initial data for Rgba32Float

What actually happened

It is hardcoded to have just 4 null bytes regardless of specified texture format.

Additional information

Problem is here:
/.cargo/registry/src/github.jparrowsec.cn-1ecc6299db9ec823/bevy_sprite-0.5.0/src/texture_atlas_builder.rs:174

                Ok(rect_placements) => {
                    atlas_texture = Texture::new_fill(
                        Extent3d::new(current_width, current_height, 1),
                        TextureDimension::D2,
                        &[0, 0, 0, 0], // <--- should not be hardcoded
                        self.format,
                    );
                    Some(rect_placements)
                }
@hamstakilla hamstakilla added C-Bug An unexpected or incorrect behavior S-Needs-Triage This issue needs to be labelled labels Oct 6, 2021
@mockersf
Copy link
Member

mockersf commented Oct 6, 2021

thanks for the report! that should be fixed in #2920

@DJMcNab
Copy link
Member

DJMcNab commented Oct 6, 2021

Why has this issue been closed?

The fix hasn't been merged yet.

@hamstakilla
Copy link
Author

Sorry i have no clue how to use github properly.

@hamstakilla hamstakilla reopened this Oct 6, 2021
@mockersf
Copy link
Member

mockersf commented Oct 6, 2021

No worries 👍

The issue will be automatically closed if a PR that fixes it is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-Bug An unexpected or incorrect behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants