mirror of
https://gitlab.bixilon.de/bixilon/minosoft.git
synced 2025-09-17 03:15:35 -04:00
add static offset to clouds
("fixes" face fighting with blocks/general)
This commit is contained in:
parent
199d8abe2a
commit
a3a98c2897
@ -31,8 +31,8 @@ class CloudMesh(renderWindow: RenderWindow) : Mesh(renderWindow, CloudMeshStruct
|
||||
|
||||
|
||||
fun createCloud(start: Vec2i, end: Vec2i, yStart: Int, yEnd: Int, culling: BooleanArray) {
|
||||
val start = Vec3(start.x, yStart, start.y)
|
||||
val end = Vec3(end.x, yEnd, end.y)
|
||||
val start = Vec3(start.x, yStart, start.y) + CLOUD_OFFSET
|
||||
val end = Vec3(end.x, yEnd, end.y) + CLOUD_OFFSET
|
||||
|
||||
addYQuad(Vec2(start.x, start.z), end.y, Vec2(end.x, end.z)) { position, _ -> addVertex(position, Directions.UP) }
|
||||
addYQuad(Vec2(start.x, start.z), start.y, Vec2(end.x, end.z)) { position, _ -> addVertex(position, Directions.DOWN) }
|
||||
@ -59,4 +59,8 @@ class CloudMesh(renderWindow: RenderWindow) : Mesh(renderWindow, CloudMeshStruct
|
||||
) {
|
||||
companion object : MeshStruct(CloudMeshStruct::class)
|
||||
}
|
||||
|
||||
companion object {
|
||||
private const val CLOUD_OFFSET = 0.24f // prevents face fighting with pretty much all blocks
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user