Add albedo to material visualization

This commit is contained in:
hal8174 2024-12-31 18:04:52 +01:00
parent 9195b48079
commit 829476c602
3 changed files with 43 additions and 15 deletions

View file

@ -16,11 +16,6 @@ use super::ExampleScene;
pub fn scene<R: Rng + Debug + 'static>() -> ExampleScene<R> {
let f = || {
let color = Color::new(0.2, 0.2, 0.9);
// let m = DiffuseMaterial::new(color);
let m = Microfacet::new(BeckmannDistribution::new(0.1), color);
// let m = OrenNayar::new(0.5, color);
let obj = ObjData::new("ray-tracing-scene/obj/stanford_dragon.obj").unwrap();
let mut triangles = obj
@ -28,8 +23,9 @@ pub fn scene<R: Rng + Debug + 'static>() -> ExampleScene<R> {
.map(|t| Triangle::new(t.v, 0))
.collect::<Vec<_>>();
let color = Color::new(0.2, 0.2, 0.9);
let materials = vec![
BVHMaterial::new_material(m),
BVHMaterial::new_material(Microfacet::new(BeckmannDistribution::new(0.01), color)),
BVHMaterial::new_material(OrenNayar::new(0.5, Color::new(0.8, 0.8, 0.8))),
BVHMaterial::new_material(OrenNayar::new(0.5, Color::new(0.9, 0.0, 0.0))),
BVHMaterial::new_material(OrenNayar::new(0.5, Color::new(0.0, 0.9, 0.0))),