Better rock colours

This commit is contained in:
Joshua Barretto 2019-06-18 12:55:25 +01:00
parent bc7cee1846
commit aa28f0b427

View File

@ -165,7 +165,11 @@ impl<'a> SamplerMut for BlockGen<'a> {
// Rocks
let block = block.or_else(|| {
if (height + 2.5 - wposf.z as f32).div(7.5).abs().powf(2.0) < rock {
Some(warm_stone)
let field0 = RandomField::new(self.world.sim().seed + 0);
let field1 = RandomField::new(self.world.sim().seed + 1);
let field2 = RandomField::new(self.world.sim().seed + 2);
Some(Block::new(2, stone_col - Rgb::new(field0.get(wpos) as u8 % 32, field1.get(wpos) as u8 % 32, field2.get(wpos) as u8 % 32)))
} else {
None
}