1
0
mirror of https://github.com/luanti-org/luanti.git synced 2025-10-25 05:35:25 +02:00

Fix texture coordinates of cuboid drawtypes (#16091)

Fixes issues related to combining animated and world-aligned textures.
Changes texture coordinates of cuboid drawtypes to stay in the [0,1] range, instead of carrying the mapblock alignment and becoming negative after transformations.
This commit is contained in:
cx384
2025-05-24 15:59:32 +02:00
committed by GitHub
parent 2f1171e2a7
commit d17f22f536
4 changed files with 80 additions and 47 deletions

View File

@@ -86,7 +86,7 @@ private:
template <typename Fn>
void drawCuboid(const aabb3f &box, const TileSpec *tiles, int tilecount,
const f32 *txc, u8 mask, Fn &&face_lighter);
void generateCuboidTextureCoords(aabb3f const &box, f32 *coords);
static void generateCuboidTextureCoords(aabb3f const &box, f32 *coords);
void drawAutoLightedCuboid(aabb3f box, const TileSpec &tile, f32 const *txc = nullptr, u8 mask = 0);
void drawAutoLightedCuboid(aabb3f box, const TileSpec *tiles, int tile_count, f32 const *txc = nullptr, u8 mask = 0);
u8 getNodeBoxMask(aabb3f box, u8 solid_neighbors, u8 sametype_neighbors) const;