Skip to content

Tilemaps are drawn by UI cameras - #143

Merged
eduardodoria merged 1 commit into
doriaxengine:mainfrom
WaruGameDev:fix/tilemap-face-culling
Nov 24, 2026
Merged

eduardodoria merged 1 commit into
doriaxengine:mainfrom
WaruGameDev:fix/tilemap-face-culling

Conversation

@WaruGameDev

Copy link
Copy Markdown
Contributor

Problem

A Tilemap in a scene whose camera is CAMERA_UI loads fine (vertices, texture and bounds are all correct) but draws nothing, and nothing is logged. Sprites in the same scene are drawn.

The UI camera projects y-down, which reverses the winding of the tile quads, so with face culling on every tile is dropped as a back face. MeshSystem::createSprite already avoids this with mesh.submeshes[0].faceCulling = false; createTilemap did not.

Fix

createTilemap turns face culling off on each of its submeshes, as createSprite does for its one.

Testing

A small program that builds a scene with a CAMERA_UI camera and a Tilemap with two tiles, calls createTilemap() and reads the MeshComponent:

  • on main: submeshes[0].faceCulling == true
  • with this change: faceCulling == false

The engine library builds with MSVC (VS 2022, Debug). The blank tilemap was first found in an app drawing a level with a UI camera; turning culling off on the tilemap made it appear.

🤖 Generated with Claude Code

A UI camera projects y-down, which reverses the winding of the tile quads,
so with face culling on every tile was dropped as a back face and the
tilemap drew nothing, with no error. Sprites already turn culling off in
createSprite; createTilemap now does the same for each submesh.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@eduardodoria
eduardodoria merged commit 44a3de6 into doriaxengine:main Nov 24, 2026
3 checks passed
@eduardodoria

Copy link
Copy Markdown
Contributor

Merged! Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants