mirror of
https://github.com/GayPizzaSpecifications/voxelotl-engine.git
synced 2025-08-03 13:11:33 +00:00
linearise block colours at generation time
This commit is contained in:
@ -112,7 +112,7 @@ public struct Chunk {
|
|||||||
|
|
||||||
public enum BlockType: Equatable {
|
public enum BlockType: Equatable {
|
||||||
case air
|
case air
|
||||||
case solid(_ color: Color<UInt8>)
|
case solid(_ color: Color<Float16>)
|
||||||
}
|
}
|
||||||
|
|
||||||
public struct Block {
|
public struct Block {
|
||||||
|
@ -36,7 +36,7 @@ class Game: GameDelegate {
|
|||||||
var random = DarwinRandom(seed: Arc4Random.instance.next(in: DarwinRandom.max))
|
var random = DarwinRandom(seed: Arc4Random.instance.next(in: DarwinRandom.max))
|
||||||
self.chunk.fill(allBy: {
|
self.chunk.fill(allBy: {
|
||||||
if (random.next() & 0x1) == 0x1 {
|
if (random.next() & 0x1) == 0x1 {
|
||||||
.solid(.init(rgb888: UInt32(random.next(in: 0..<0xFFFFFF+1))))
|
.solid(.init(rgb888: UInt32(random.next(in: 0..<0xFFFFFF+1))).linear)
|
||||||
} else {
|
} else {
|
||||||
.air
|
.air
|
||||||
}
|
}
|
||||||
@ -84,7 +84,7 @@ class Game: GameDelegate {
|
|||||||
Instance(
|
Instance(
|
||||||
position: SIMD3<Float>(position) + 0.5,
|
position: SIMD3<Float>(position) + 0.5,
|
||||||
scale: .init(repeating: 0.5),
|
scale: .init(repeating: 0.5),
|
||||||
color: Color<Float16>(color).linear)
|
color: color)
|
||||||
} else { nil }
|
} else { nil }
|
||||||
}
|
}
|
||||||
if !instances.isEmpty {
|
if !instances.isEmpty {
|
||||||
|
Reference in New Issue
Block a user