feat(TU25): add new render layer for water so some semi transparent objects don't cull water

This commit is contained in:
Patoke
2026-04-22 09:43:31 +10:00
committed by la
parent 0b3b9c4c9f
commit b3fb0e9ec0
6 changed files with 51 additions and 31 deletions
+13
View File
@@ -17,6 +17,19 @@ bool HalfTransparentTile::isSolidRender(bool isServerLevel)
bool HalfTransparentTile::shouldRenderFace(LevelSource *level, int x, int y, int z, int face)
{
int id = level->getTile(x, y, z);
if (this->id == 95) // Tile::stained_glass
{
bool isBlocking = level->isTopSolidBlocking(x, y, z);
if (face == 0 && level->isSolidBlockingTile(x, y + 1, z) != isBlocking) return true; // Facing::DOWN
else if (face == 1 && level->isTopSolidBlocking(x, y - 1, z) != isBlocking) return true; // Facing::UP
else if (face == 2 && level->isSolidBlockingTile(x, y, z + 1) != isBlocking) return true; // Facing::NORTH
else if (face == 3 && level->isSolidBlockingTile(x, y, z - 1) != isBlocking) return true; // Facing::SOUTH
else if (face == 4 && level->isSolidBlockingTile(x + 1, y, z) != isBlocking) return true; // Facing::WEST
else if (face == 5 && level->isSolidBlockingTile(x - 1, y, z) != isBlocking) return true; // Facing::EAST
else if (face == 6 && level->isSolidBlockingTile(x, y, z) != isBlocking) return true; // not really a direction? is this supposed to be here?
}
if (!allowSame && id == this->id) return false;
return Tile::shouldRenderFace(level, x, y, z, face);
}