From 741ed649f0ff8737db4738019691190788d2f4f6 Mon Sep 17 00:00:00 2001 From: WaruGameDev <60048774+WaruGameDev@users.noreply.github.com> Date: Mon, 23 Nov 2026 10:32:52 -0300 Subject: [PATCH] Tilemaps are drawn by UI cameras 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 --- engine/core/subsystem/MeshSystem.cpp | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/engine/core/subsystem/MeshSystem.cpp b/engine/core/subsystem/MeshSystem.cpp index e8a8653e3..500a252c6 100644 --- a/engine/core/subsystem/MeshSystem.cpp +++ b/engine/core/subsystem/MeshSystem.cpp @@ -715,6 +715,12 @@ bool MeshSystem::createTilemap(TilemapComponent& tilemap, MeshComponent& mesh){ mesh.submeshes[0].primitiveType = PrimitiveType::TRIANGLES; mesh.submeshes[0].hasTextureRect = true; + // Like sprites (createSprite): a UI camera projects y-down, which reverses the + // tiles' winding, so with culling on every tile is dropped as a back face. + for (unsigned int s = 0; s < mesh.numSubmeshes; s++){ + mesh.submeshes[s].faceCulling = false; + } + mesh.buffer.clear(); mesh.buffer.addAttribute(AttributeType::POSITION, 3); mesh.buffer.addAttribute(AttributeType::TEXCOORD1, 2);