From 38a67a689062ec8e676434b466763c896a13e739 Mon Sep 17 00:00:00 2001 From: "max.nuding" Date: Thu, 7 Jul 2022 09:18:21 +0200 Subject: [PATCH] Add marbled texture --- src/noise.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/noise.rs b/src/noise.rs index 8a75355..e5c3eb5 100644 --- a/src/noise.rs +++ b/src/noise.rs @@ -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()) } }