rtiow: run cargo update and fix build_all_features.sh errors.

This commit is contained in:
Bill Thiede 2022-09-17 16:51:21 -07:00
parent 4066bf4b85
commit a12938db95
3 changed files with 977 additions and 591 deletions

1550
rtiow/Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -3,12 +3,9 @@ use std::sync::Arc;
use crate::{ use crate::{
aabb::AABB, aabb::AABB,
cuboid::Cuboid, cuboid::Cuboid,
flip_normals::FlipNormals,
hitable::{Hit, HitRecord}, hitable::{Hit, HitRecord},
hitable_list::HitableList,
material::Material, material::Material,
ray::Ray, ray::Ray,
rect::{XYRect, XZRect, YZRect},
vec3::Vec3, vec3::Vec3,
}; };
@ -136,7 +133,7 @@ impl Hit for Glowybox {
} }
} }
fn bounding_box(&self, t_min: f32, t_max: f32) -> Option<AABB> { fn bounding_box(&self, _t_min: f32, _t_max: f32) -> Option<AABB> {
Some(AABB::new(self.p_min, self.p_max)) Some(AABB::new(self.p_min, self.p_max))
} }
} }

View File

@ -1,22 +1,18 @@
use std::sync::Arc; use std::sync::Arc;
use image;
use log::info; use log::info;
use rand;
use crate::{ use crate::{
camera::Camera, camera::Camera,
cuboid::Cuboid,
glowybox::Glowybox, glowybox::Glowybox,
hitable::Hit, hitable::Hit,
hitable_list::HitableList, hitable_list::HitableList,
kdtree::KDTree, kdtree::KDTree,
material::{DiffuseLight, Lambertian}, material::{DiffuseLight, Lambertian},
noise::{perlin::Perlin, NoiseType},
rect::{XYRect, XZRect, YZRect}, rect::{XYRect, XZRect, YZRect},
renderer::{Opt, Scene}, renderer::{Opt, Scene},
sphere::Sphere, sphere::Sphere,
texture::{ConstantTexture, ImageTexture, NoiseTexture}, texture::ConstantTexture,
vec3::Vec3, vec3::Vec3,
}; };
@ -38,18 +34,12 @@ pub fn new(opt: &Opt) -> Scene {
time_min, time_min,
time_max, time_max,
); );
let rng = &mut rand::thread_rng();
let ground_color = if opt.use_accel { let ground_color = if opt.use_accel {
ConstantTexture::new(Vec3::new(1.0, 0.4, 0.4)) ConstantTexture::new(Vec3::new(1.0, 0.4, 0.4))
} else { } else {
ConstantTexture::new(Vec3::new(0.4, 1.0, 0.4)) ConstantTexture::new(Vec3::new(0.4, 1.0, 0.4))
}; };
let world_image_bytes = include_bytes!("../../images/world.jpg");
let it = ImageTexture::new(image::load_from_memory(world_image_bytes).unwrap().to_rgb());
let noise_source = Perlin::new(rng);
let noise_type = NoiseType::Scale(10.);
let lights: Vec<Box<dyn Hit>> = vec![ let lights: Vec<Box<dyn Hit>> = vec![
Box::new(XZRect::new( Box::new(XZRect::new(
-100., -100.,
@ -106,7 +96,6 @@ pub fn new(opt: &Opt) -> Scene {
Vec3::new(0., -1010., 0.), Vec3::new(0., -1010., 0.),
1000., 1000.,
Lambertian::new(ground_color), Lambertian::new(ground_color),
// Lambertian::new(NoiseTexture::new(noise_source, noise_type)),
)), )),
Box::new(Glowybox::new( Box::new(Glowybox::new(
[-4., -4., -4.].into(), [-4., -4., -4.].into(),