Resolve all warnings.

This commit is contained in:
hal8174 2025-05-28 19:27:55 +02:00
parent 86d009fb4c
commit 96e7085e37
Signed by: hal8174
SSH key fingerprint: SHA256:JwuqS+eVfISfKr+DkDQ6NWAbGd1jFAHkPpCM1yCnlTs
10 changed files with 92 additions and 86 deletions

View file

@ -83,7 +83,7 @@ impl<A: AccelerationStructure<u32>, R: Rng> Scene<R> for AccelerationStructureSc
let material = &self.materials[i as usize];
let light_pdf = if let Some(l) = &material.light {
let light_pdf = if let Some(_l) = &material.light {
0.0
} else {
0.0

View file

@ -19,6 +19,12 @@ impl<R: Rng> BasicCornell<R> {
}
}
impl<R: Rng> Default for BasicCornell<R> {
fn default() -> Self {
Self::new()
}
}
impl<R: Rng + 'static> ExampleScene<R> for BasicCornell<R> {
fn get_scene(&self) -> Box<dyn Scene<R> + Sync> {
let s = self.scene.get_or_init(|| {

View file

@ -22,6 +22,12 @@ impl<R: Rng> Cornell2<R> {
}
}
impl<R: Rng> Default for Cornell2<R> {
fn default() -> Self {
Self::new()
}
}
impl<R: Rng + 'static> ExampleScene<R> for Cornell2<R> {
fn get_scene(&self) -> Box<dyn Scene<R> + Sync> {
let s = self.scene.get_or_init(|| {

View file

@ -1,15 +1,11 @@
use std::cell::OnceCell;
use crate::triangle_bvh::{BVHMaterial, Triangle, TriangleBVH};
use super::ExampleScene;
use crate::triangle_bvh::{BVHMaterial, Triangle, TriangleBVH};
use ray_tracing_core::{light::AreaLight, prelude::*, scene::Scene};
use ray_tracing_material::{
diffuse::DiffuseMaterial,
microfacet::{BeckmannDistribution, Microfacet},
mirror::Mirror,
};
use std::cell::OnceCell;
pub struct MISTest<R: Rng> {
scene: OnceCell<TriangleBVH<R>>,
@ -67,6 +63,12 @@ impl<R: Rng> MISTest<R> {
}
}
impl<R: Rng> Default for MISTest<R> {
fn default() -> Self {
Self::new()
}
}
impl<R: Rng + 'static> ExampleScene<R> for MISTest<R> {
fn get_scene(&self) -> Box<dyn Scene<R> + Sync> {
let s = self.scene.get_or_init(move || {

View file

@ -49,7 +49,7 @@ pub fn example_scenes<R: Rng + Debug + 'static>() -> HashMap<&'static str, Box<d
);
map.insert("mis_test", Box::new(mis_test::MISTest::new()));
let material = Iridescent::new(250.0, 250.0, 1.0, 1.3, 20);
// let material = Iridescent::new(250.0, 250.0, 1.0, 1.3, 20);
let material = Iridescent::new(0.9 * 988.0, 0.1 * 988.0, 1.0, 1.5, 20);
map.insert("sphere", Box::new(sphere::SphereScene::new(material)));
map

View file

@ -1,13 +1,7 @@
use std::{
cell::{Cell, OnceCell},
marker::PhantomData,
};
use ray_tracing_core::prelude::*;
use crate::basic_scene::BasicScene;
use super::ExampleScene;
use crate::basic_scene::BasicScene;
use ray_tracing_core::prelude::*;
use std::cell::{Cell, OnceCell};
pub struct SphereScene<M> {
scene: OnceCell<BasicScene<M>>,

View file

@ -1,15 +1,11 @@
use rand::Rng;
use ray_tracing_core::{light::AreaLight, prelude::*, scene::Scene};
use ray_tracing_material::{
microfacet::{BeckmannDistribution, Microfacet},
oren_nayar::OrenNayar,
};
use std::cell::{Cell, OnceCell};
use crate::{
parse_obj::ObjData,
triangle_bvh::{BVHMaterial, Triangle, TriangleBVH},
};
use rand::Rng;
use ray_tracing_core::{light::AreaLight, prelude::*, scene::Scene};
use ray_tracing_material::oren_nayar::OrenNayar;
use std::cell::{Cell, OnceCell};
use super::ExampleScene;

View file

@ -28,6 +28,12 @@ impl<R: Rng> StanfordDragon<R> {
}
}
impl<R: Rng> Default for StanfordDragon<R> {
fn default() -> Self {
Self::new()
}
}
impl<R: Rng + 'static> ExampleScene<R> for StanfordDragon<R> {
fn get_scene(&self) -> Box<dyn Scene<R> + Sync> {
let s = self.scene.get_or_init(|| {