Add ConstantTexture and use it for Lambertian material.
This commit is contained in:
@@ -234,6 +234,7 @@ mod tests {
|
||||
use material::Lambertian;
|
||||
use material::Metal;
|
||||
use sphere::Sphere;
|
||||
use texture::ConstantTexture;
|
||||
use vec3::Vec3;
|
||||
|
||||
use super::*;
|
||||
@@ -245,7 +246,9 @@ mod tests {
|
||||
Box::new(Sphere::new(
|
||||
Vec3::new(0., 0., 0.),
|
||||
0.5,
|
||||
Box::new(Lambertian::new(Vec3::new(0.1, 0.2, 0.5))),
|
||||
Box::new(Lambertian::new(Box::new(ConstantTexture::new(Vec3::new(
|
||||
0.1, 0.2, 0.5,
|
||||
))))),
|
||||
)),
|
||||
Box::new(Sphere::new(
|
||||
Vec3::new(1., 0., 0.),
|
||||
@@ -271,7 +274,9 @@ mod tests {
|
||||
Box::new(Sphere::new(
|
||||
Vec3::new(0., 0., 0.),
|
||||
0.5,
|
||||
Box::new(Lambertian::new(Vec3::new(0.1, 0.2, 0.5))),
|
||||
Box::new(Lambertian::new(Box::new(ConstantTexture::new(Vec3::new(
|
||||
0.1, 0.2, 0.5,
|
||||
))))),
|
||||
)),
|
||||
Box::new(Sphere::new(
|
||||
Vec3::new(1., 0., 0.),
|
||||
|
||||
Reference in New Issue
Block a user