Skip to content

TilemapSpritebatchRenderer culls oversized image collection tiles too early #1139

Description

@AristurtleDev

Description

When a tile layer contains tiles from a Tiled image collection tileset whee the rendered image is larger than the map cell, TilemapSpriteBatchRenderer can stop drawing those tiles too early when they are partially visible near the left or bottom edge of the screen.

This does not reproduce in `TilemapRenderer

The problem appears to be int eh SpriteBatch renderer culling, where it computes visibility using the logical tile cel bounds but image collection tiles can render outside those bounds. This means a tile may still be partially visible even after its owning map cell has moved outside the visible region.

Steps to Reproduce

  1. Clone the repo sample https://github.com/Grompie/TilemapReproApp
  2. Run sample
  3. Leave BridgeLayer eanbled
  4. Use the default TilemapSpriteBatchRenderer
  5. Move the camera so that one of the bridge tiles is partially offscreen on the left or bottom edge
  6. Notice that the bridge disappears sooner than expected
  7. Press Tab to switch to TilemapRenderer
  8. Notice that it does not disappear using the TilemapRenderer

Expected Behavior

Oversized image collection tiles should remain visible for as long as any portion of their rendered image overlaps the viewport, regardless of whether their logical map cel has already moved offscreen. The behavior should be consistent between TilemapSpriteBatchRenderer and TilemapRenderer

Actual Behavior

TilemapSpritebatchRenderer culls the tiles too early at the left and bottom edges.

Configuration

MonoGame.Extended version 6.0.0-preview.3

Other Information

TilemapSpriteBatchRenderer showing the bridges on the left are culled early

Image

TilemapRenderer of the same view showing that they are not culled early using it

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething is broken, crashes, regresses, or behaves unexpectedlyscope: tilemapTilemap systems, tile layers, chunking, rendering, and related data structures

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions