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