Add marbled texture

This commit is contained in:
max.nuding 2022-07-07 09:18:21 +02:00
parent 0e72e21f92
commit 38a67a6890
Failed to extract signature

View File

@ -9,6 +9,9 @@ pub struct NoiseTexture {
impl Texture for NoiseTexture {
fn value(&self, _u: f64, _v: f64, point: &Point3) -> Color {
Color::new(1.0, 1.0, 1.0) * self.noise.default_turbulence(&(*point * self.scale))
let sin = self.scale * point.z() + 10.0 * self.noise.default_turbulence(point);
Color::new(1.0, 1.0, 1.0)
* 0.5
* (1.0 + sin.sin())
}
}