Add marbled texture
This commit is contained in:
parent
0e72e21f92
commit
38a67a6890
@ -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())
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user