diff options
author | lamp | 2024-01-21 17:03:07 +0000 |
---|---|---|
committer | lamp | 2024-01-21 17:03:07 +0000 |
commit | 45fafbcd4b41a5388ece377c4e051b5846407288 (patch) | |
tree | 2192c471ca3b47671f0906e27f6f6088f40b3d8a /src/texture/noise_texture.rs | |
parent | 89a5c9a8a0cdf627cda0e31da454f83ca21315ce (diff) |
fmt and tidy
Diffstat (limited to 'src/texture/noise_texture.rs')
-rw-r--r-- | src/texture/noise_texture.rs | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/texture/noise_texture.rs b/src/texture/noise_texture.rs index 92ac166..7fe3cdb 100644 --- a/src/texture/noise_texture.rs +++ b/src/texture/noise_texture.rs @@ -1,4 +1,4 @@ -use super::{Texture, perlin::Perlin}; +use super::{perlin::Perlin, Texture}; use crate::{vec3::Color, vec3::Point3}; pub struct NoiseTexture { @@ -17,6 +17,11 @@ impl NoiseTexture { impl Texture for NoiseTexture { fn value(&self, _: f64, _: f64, p: &Point3) -> Color { - Color { x: 1.0, y: 1.0, z: 1.0 } * 0.5 * (1.0 + (self.scale * p.z + 10.0 * self.noise.turb(p, 7)).sin()) + Color { + x: 1.0, + y: 1.0, + z: 1.0, + } * 0.5 + * (1.0 + (self.scale * p.z + 10.0 * self.noise.turb(p, 7)).sin()) } } |