diff --git a/rtiow/renderer/src/scenes/stltest.rs b/rtiow/renderer/src/scenes/stltest.rs index c8a981d..816d103 100644 --- a/rtiow/renderer/src/scenes/stltest.rs +++ b/rtiow/renderer/src/scenes/stltest.rs @@ -16,7 +16,7 @@ use crate::{ }; pub fn new(opt: &Opt) -> Scene { - let lookfrom = Vec3::new(100., 200., 200.); + let lookfrom = Vec3::new(-100., 200., 200.); let lookat = Vec3::new(0., 1., 0.); let dist_to_focus = 10.0; let aperture = 0.0; @@ -26,7 +26,7 @@ pub fn new(opt: &Opt) -> Scene { lookfrom, lookat, Vec3::new(0., 1., 0.), - 20., + 45., opt.width as f32 / opt.height as f32, aperture, dist_to_focus, @@ -36,7 +36,7 @@ pub fn new(opt: &Opt) -> Scene { let ground_color = if opt.use_accel { ConstantTexture::new(Vec3::new(1.0, 0.4, 0.4)) } else { - ConstantTexture::new(Vec3::new(0.4, 1.0, 0.4)) + ConstantTexture::new(Vec3::new(0.4, 0.4, 0.4)) }; let stl_cube = STL::parse( @@ -48,7 +48,7 @@ pub fn new(opt: &Opt) -> Scene { let light_height = 200.; let tri_mesh = Triangles::new( &stl_cube, - Lambertian::new(ConstantTexture::new(Vec3::new(1., 0.1, 0.1))), + Lambertian::new(ConstantTexture::new(Vec3::new(1., 1., 1.))), 1., ); dbg!(tri_mesh.triangles.len(), tri_mesh.bbox); diff --git a/rtiow/renderer/src/triangles.rs b/rtiow/renderer/src/triangles.rs index 17efbb5..57827d7 100644 --- a/rtiow/renderer/src/triangles.rs +++ b/rtiow/renderer/src/triangles.rs @@ -83,6 +83,7 @@ where { // Based on https://www.scratchapixel.com/lessons/3d-basic-rendering/ray-tracing-rendering-a-triangle/ray-triangle-intersection-geometric-solution.html fn hit(&self, r: Ray, _t_min: f32, _t_max: f32) -> Option { + // TODO(wathiede): add an acceleration structure to more cheaply skip some triangles. for tri in &self.triangles { let n = tri.normal;