Fix nans for iridescent material

This commit is contained in:
hal8174 2025-05-24 22:45:46 +02:00
parent c26a4bece0
commit e3009563ba
Signed by: hal8174
SSH key fingerprint: SHA256:JwuqS+eVfISfKr+DkDQ6NWAbGd1jFAHkPpCM1yCnlTs
3 changed files with 42 additions and 10 deletions

View file

@ -28,7 +28,7 @@ pub fn example_scenes<R: Rng + Debug + 'static>() -> HashMap<&'static str, Box<d
"stanford_dragon_microfacet",
Box::new(stanford_dragon::StanfordDragon::new(material)),
);
let material = Iridescent::new(300.0, 300.0, 1.0, 1.5, 10);
let material = Iridescent::new(100.0, 900.0, 1.0, 1.5, 20);
map.insert(
"stanford_dragon_iridescent",
Box::new(stanford_dragon::StanfordDragon::new(material)),

View file

@ -40,8 +40,8 @@ impl<R: Rng + 'static, M: Material<R> + 'static> ExampleScene<R> for StanfordDra
let materials = vec![
BVHMaterial::new_material(self.material.take().unwrap()),
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))),
BVHMaterial::new_material(OrenNayar::new(0.5, Color::new(0.9, 0.2, 0.2))),
BVHMaterial::new_material(OrenNayar::new(0.5, Color::new(0.2, 0.9, 0.2))),
BVHMaterial::new_light(AreaLight::new(Color::white() * 30.0)),
];