Add eval to visualizer and fix pbr error

This commit is contained in:
hal8174 2024-12-26 00:57:57 +01:00
parent 109a72c19a
commit 3a37a72f56
10 changed files with 105 additions and 55 deletions

View file

@ -64,7 +64,7 @@ pub fn scene<R: Rng + 'static>() -> ExampleScene<R> {
},
BVHMaterial {
material: None,
light: Some(Box::new(AreaLight::new(Color::white() * 30.0))),
light: Some(Box::new(AreaLight::new(Color::white() * 18.0))),
},
BVHMaterial {
material: Some(Box::new(Mirror::new(Color::new(1.0, 1.0, 1.0)))),

View file

@ -24,7 +24,7 @@ pub fn scene<R: Rng + Debug + 'static>() -> ExampleScene<R> {
.iter()
.map(|m| match m.name.as_str() {
"white" => BVHMaterial::new_material(DiffuseMaterial::new(Color::white())),
"light" => BVHMaterial::new_light(AreaLight::new(Color::white() * 100.0)),
"light" => BVHMaterial::new_light(AreaLight::new(Color::white() * 30.0)),
"blue" => {
BVHMaterial::new_material(DiffuseMaterial::new(Color::new(0.0, 0.0, 1.0)))
}

View file

@ -21,7 +21,7 @@ pub fn scene<R: Rng + Debug + 'static>() -> ExampleScene<R> {
let materials = vec![
BVHMaterial::new_material(DiffuseMaterial::new(Color::new(0.2, 0.2, 0.9))),
BVHMaterial::new_light(AreaLight::new(Color::white() * 100.0)),
BVHMaterial::new_light(AreaLight::new(Color::white() * 30.0)),
];
let mut vertices = obj.vertices;