From dc00c01bf9b012927d44191c024f1ec4784f5f64 Mon Sep 17 00:00:00 2001 From: Moritz Zwerger Date: Sun, 30 Jul 2023 18:43:48 +0200 Subject: [PATCH] remove cull face Determinant by minosoft now. maybe transparency breaks --- .../minosoft/gui/rendering/models/BlockModelTest.kt | 12 ++++++------ .../rendering/models/block/element/face/ModelFace.kt | 4 +--- .../block/state/apply/SingleBlockStateApply.kt | 2 +- .../rendering/models/block/state/baked/BakedFace.kt | 2 +- 4 files changed, 9 insertions(+), 11 deletions(-) diff --git a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/BlockModelTest.kt b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/BlockModelTest.kt index 2a16f8542..2bbd4fa23 100644 --- a/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/BlockModelTest.kt +++ b/src/integration-test/kotlin/de/bixilon/minosoft/gui/rendering/models/BlockModelTest.kt @@ -150,12 +150,12 @@ class BlockModelTest { from = Vec3(0, 0, 0), to = Vec3(1, 1, 1), faces = mapOf( - Directions.DOWN to ModelFace("#down", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, Directions.DOWN, -1), - Directions.UP to ModelFace("#up", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, Directions.UP, -1), - Directions.NORTH to ModelFace("#north", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, Directions.NORTH, -1), - Directions.SOUTH to ModelFace("#south", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, Directions.SOUTH, -1), - Directions.WEST to ModelFace("#west", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, Directions.WEST, -1), - Directions.EAST to ModelFace("#east", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, Directions.EAST, -1), + Directions.DOWN to ModelFace("#down", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, -1), + Directions.UP to ModelFace("#up", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, -1), + Directions.NORTH to ModelFace("#north", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, -1), + Directions.SOUTH to ModelFace("#south", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, -1), + Directions.WEST to ModelFace("#west", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, -1), + Directions.EAST to ModelFace("#east", FaceUV(Vec2(0, 1), Vec2(1, 0)), 0, -1), ), shade = true, rotation = null, diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/element/face/ModelFace.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/element/face/ModelFace.kt index c2ec8cc58..59b230c45 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/element/face/ModelFace.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/element/face/ModelFace.kt @@ -36,7 +36,6 @@ data class ModelFace( val texture: String, val uv: FaceUV, val rotation: Int, - val cull: Directions?, val tintIndex: Int = -1, ) { @@ -79,10 +78,9 @@ data class ModelFace( } ?: fallbackUV(direction, from, to) val rotation = data["rotation"]?.toInt()?.rotation() ?: 0 - val cull = data["cullface"]?.toString()?.let { if (it == "none") null else Directions[it] } val tintIndex = data["tintindex"]?.toInt() ?: TintManager.DEFAULT_TINT_INDEX - return ModelFace(texture, uv, rotation, cull, tintIndex) + return ModelFace(texture, uv, rotation, tintIndex) } fun deserialize(from: Vec3, to: Vec3, data: Map): Map? { diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/state/apply/SingleBlockStateApply.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/state/apply/SingleBlockStateApply.kt index cbf3c5469..3fcb01929 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/state/apply/SingleBlockStateApply.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/state/apply/SingleBlockStateApply.kt @@ -146,7 +146,7 @@ data class SingleBlockStateApply( val shade = rotatedDirection.shade val a = positions.properties(rotatedDirection) - val bakedFace = BakedFace(positions, uv, shade, face.tintIndex, face.cull, texture, a) + val bakedFace = BakedFace(positions, uv, shade, face.tintIndex, if (a == null) null else rotatedDirection, texture, a) bakedFaces[rotatedDirection.ordinal] += bakedFace properties[rotatedDirection.ordinal] += a ?: continue diff --git a/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/state/baked/BakedFace.kt b/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/state/baked/BakedFace.kt index 48b35b8c4..94f0e91c5 100644 --- a/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/state/baked/BakedFace.kt +++ b/src/main/java/de/bixilon/minosoft/gui/rendering/models/block/state/baked/BakedFace.kt @@ -30,7 +30,7 @@ class BakedFace( val uv: FloatArray, val shade: Float, val tintIndex: Int, - val cull: Directions?, + cull: Directions?, val texture: Texture, val properties: FaceProperties? = null, ) {