decrease memory usage by storing chunk colours as 8bit (at the cost of slower mesh generation)

This commit is contained in:
2024-09-09 02:34:04 +10:00
parent 53e1f9cc7e
commit d4b1377238
4 changed files with 6 additions and 6 deletions

View File

@ -32,9 +32,9 @@ struct StandardWorldGenerator: WorldGenerator {
if self.ravineMask.get(position * SIMD3(1, 0.441, 1)) >= 0.8 &&
abs(self.ravineNoise.get(position * SIMD3(1, 0.6, 1))) <= 0.1 { return .air }
#endif
return .solid(.init(
return .solid(Color<UInt8>(.init(
hue: Float(180 + self.colorNoise.get(position) * 180),
saturation: 0.47, value: 0.9).linear)
saturation: 0.47, value: 0.9)))
}
let chunkOrigin = chunkID.getPosition()