Skip to content

TilemapChunk texture bleeding #22250

@Badgerup1510

Description

@Badgerup1510

Bevy version and features

bevy = "0.17.3"
perlin2d = "0.2.6"
accesskit = "0.21"

What you did

I am using the TilemapChunk Component introduced in bevy 0.17. I set up a simple 'wires' chunk. The background of the image is transparent.
It was spawned as a Child of an entity in this manner:

let chunk_size = UVec2::splat(3); 
let tile_display_size = UVec2::splat(64); 
let tile_data: Vec<Option<TileData>> = (0..chunk_size.element_product())
    .map(|i| i % 16)
    .map(|i| Some(TileData::from_tileset_index(i as u16)))
    .collect();

               // Most of spawn code omitted for simplicty
                (
                    WorldObjectLayer::Wire,
                    TilemapChunk {
                        chunk_size,
                        tile_display_size,
                        tileset: assets.load("textures/wires.png"),
                        ..default()
                    },
                    TilemapChunkTileData(tile_data.clone()),
                    Transform::from_xyz(0.0, 0.0, 4.0),
                ),

ImagePlugin is set to nearest:

app.add_plugins(DefaultPlugins.set(ImagePlugin::default_nearest()));

What went wrong

I expected a clear distribution of tiles. I found a distribution of tiles but with slight bleeding of assets along the edges. See attached image

Additional information

Image

I would have to suspect this is either a bug with how the Tilemap's image is constructed in Bevy or it is some sort of graphics API issue with small textures.

The texture is 16 pixels wide and 256 tall.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-RenderingDrawing game state to the screenC-BugAn unexpected or incorrect behaviorS-Needs-InvestigationThis issue requires detective work to figure out what's going wrong

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions