#Seeing transparency checkerboard around 2d sprite

57 messages ยท Page 1 of 1 (latest)

hardy magnet
#

I must be missing something very basic, I tried to load a sprite but instead of just getting the sprite, it also draws those checkerboard png transparency things, here's my code:

    let texture = asset_server.load("lunar_lander/Asset-Sheet-with-transparency.png");

    let mut layout = TextureAtlasLayout::new_empty(UVec2::new(640, 640));
    layout.add_texture(URect::new(135,160, 200,210));
    let texture_atlas_layout = texture_atlas_layouts.add(layout);

    commands.spawn((
        Sprite::from_atlas_image(
            texture,
            TextureAtlas {
                layout: texture_atlas_layout,
                index: 0,
            },
        ),
        Transform::from_scale(Vec3::splat(6.0)),
    ));

my texture atlas is from https://mattwalkden.itch.io/lunar-battle-pack

itch.io

Hand pixeled assets for lunar lander, asteroids, space shooter games.

scarlet oriole
#

Hmm, theres another texture in the pack called Asset-Sheet-with-grid.png - are you sure this isn't accidentally the one you loaded? I mean, your code looks correct but maybe you changed it and somehow it didn't recompile after that?

hardy magnet
#

hey, thanks for responding, if I open it in Pinta it shows a different sized pattern so I'm pretty sure it has proper transparency

hardy magnet
scarlet oriole
hardy magnet
#

it really feels like I'm doing some stupid thing, I can upload my entire main to a gist if you want ๐Ÿ™‚

hardy magnet
#

in firefox, there's no checkerboard:

scarlet oriole
hardy magnet
#

yes: pic with address bar included

scarlet oriole
#

Okay, that's really really strange then...

hardy magnet
#

yeah, that's why I feel like I must've missed something mega basic, like do I need a background for this to work properly? I've just added Camera2d

scarlet oriole
#

do you ever load the version with grid anywhere? Is it in the same folder? what happens if you move the grid version, if it exists, out of the assets folder?

scarlet oriole
#

so its either a pretty bad bug with asset loading, the file actually being wrong in some way, or like... something else really dumb

hardy magnet
scarlet oriole
#

all of em?

hardy magnet
#

sorry, I'll be clearer:
don't load the grid anywhere
it is in same folder
let me try!

#

no difference if I move it out

scarlet oriole
#

Another idea: What happens if you show the entire sheet, so without a TextureAtlas?

hardy magnet
#

there is one thing!
2025-11-08T12:07:40.100336Z WARN bevy_render::renderer: The selected adapter is using a driver that only supports software rendering. This is likely to be very slow. See https://bevy.org/learn/errors/b0006/

I'm coding inside a virtual machine.... I can try to compile to wasm and load it in my host OS browser

scarlet oriole
#

oh, and another idea: what happens if you comment out the window_theme?

hardy magnet
scarlet oriole
hardy magnet
scarlet oriole
hardy magnet
#

Maybe I should, but I dont ๐Ÿ™‚

scarlet oriole
#

Do you know which software renderer is being used?

#

I haven't ever done that with bevy, dunno whther the AdapterInfo log includes that

hardy magnet
#

2025-11-08T12:07:40.100274Z INFO bevy_render::renderer: AdapterInfo { name: "llvmpipe (LLVM 20.1.2, 256 bits)", vendor: 65541, device: 0, device_type: Cpu, driver: "llvmpipe", driver_info: "Mesa 25.0.7-0ubuntu0.25.04.2 (LLVM 20.1.2)", backend: Vulkan }

scarlet oriole
#

llvmpipe, gotcha

hardy magnet
scarlet oriole
hardy magnet
scarlet oriole
#

that's very strange

hardy magnet
#

gonna try wasm/browser

hardy magnet
#

same thing there, gonna try crosscompiling it and run it on my windows machine

scarlet oriole
#

I FOUND IT AAHAHAHHAA

#

this site can show the "Overlay" in the "Hidden Pixels" option

#

apparently thats a thing?

#

anyways

scarlet oriole
#

apparently bevy renders that and many other tools dont?

hardy magnet
#

omg, what a thing
so I is it bevy doing something wrong or did the artist make the sheet weirdly?

#

I cross compiled it an ran in windows with the same result

scarlet oriole
scarlet oriole
hardy magnet
#

alright, shall I make a minum reproducable project and file a bug reprt with bevy and see what the maintainers say? ๐Ÿ™‚

scarlet oriole
hardy magnet
#

will do, I'll link to this post as well as give you credits for your findings
thanks a lot for your help and patience