Reorganizing the module tree.
Enough things had accumulated that it seemed to make sense to group some stuff together. So here it is.
This commit is contained in:
parent
d504ca5e6a
commit
f4445417dc
|
@ -6,7 +6,8 @@ use boundable::Boundable;
|
|||
use lerp::lerp_slice;
|
||||
use math::log2_64;
|
||||
use ray::AccelRay;
|
||||
use objects_split::{sah_split, median_split};
|
||||
|
||||
use super::objects_split::{sah_split, median_split};
|
||||
|
||||
|
||||
const BVH_MAX_DEPTH: usize = 64;
|
|
@ -1,25 +1,8 @@
|
|||
mod light_tree;
|
||||
|
||||
use bbox::BBox;
|
||||
use math::{Vector, Point, Normal};
|
||||
use shading::surface_closure::SurfaceClosure;
|
||||
|
||||
pub use self::light_tree::LightTree;
|
||||
|
||||
|
||||
pub trait LightAccel {
|
||||
/// Returns (index_of_light, selection_pdf, whittled_n)
|
||||
fn select(&self,
|
||||
inc: Vector,
|
||||
pos: Point,
|
||||
nor: Normal,
|
||||
sc: &SurfaceClosure,
|
||||
time: f32,
|
||||
n: f32)
|
||||
-> Option<(usize, f32, f32)>;
|
||||
|
||||
fn approximate_energy(&self) -> f32;
|
||||
}
|
||||
use super::LightAccel;
|
||||
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct LightArray {
|
|
@ -2,10 +2,10 @@ use algorithm::merge_slices_append;
|
|||
use bbox::BBox;
|
||||
use lerp::lerp_slice;
|
||||
use math::{Vector, Point, Normal};
|
||||
use objects_split::sah_split;
|
||||
use shading::surface_closure::SurfaceClosure;
|
||||
|
||||
use super::LightAccel;
|
||||
use super::objects_split::sah_split;
|
||||
|
||||
|
||||
#[derive(Debug)]
|
25
src/accel/mod.rs
Normal file
25
src/accel/mod.rs
Normal file
|
@ -0,0 +1,25 @@
|
|||
mod bvh;
|
||||
mod light_array;
|
||||
mod light_tree;
|
||||
mod objects_split;
|
||||
|
||||
use math::{Vector, Point, Normal};
|
||||
use shading::surface_closure::SurfaceClosure;
|
||||
|
||||
pub use self::bvh::BVH;
|
||||
pub use self::light_tree::LightTree;
|
||||
|
||||
|
||||
pub trait LightAccel {
|
||||
/// Returns (index_of_light, selection_pdf, whittled_n)
|
||||
fn select(&self,
|
||||
inc: Vector,
|
||||
pos: Point,
|
||||
nor: Normal,
|
||||
sc: &SurfaceClosure,
|
||||
time: f32,
|
||||
n: f32)
|
||||
-> Option<(usize, f32, f32)>;
|
||||
|
||||
fn approximate_energy(&self) -> f32;
|
||||
}
|
|
@ -5,9 +5,9 @@ use std::cmp::Ordering;
|
|||
|
||||
use algorithm::{partition, quick_select};
|
||||
use bbox::BBox;
|
||||
use halton;
|
||||
use lerp::lerp_slice;
|
||||
use math::{Vector, dot};
|
||||
use sampling::halton;
|
||||
use sampling::uniform_sample_hemisphere;
|
||||
|
||||
|
|
@ -13,23 +13,19 @@ extern crate nom;
|
|||
#[cfg(feature = "simd_perf")]
|
||||
extern crate simd;
|
||||
|
||||
mod accel;
|
||||
mod algorithm;
|
||||
mod assembly;
|
||||
mod bbox;
|
||||
mod boundable;
|
||||
mod bvh;
|
||||
mod camera;
|
||||
mod color;
|
||||
mod float4;
|
||||
mod halton;
|
||||
mod hash;
|
||||
mod hilbert;
|
||||
mod image;
|
||||
mod lerp;
|
||||
mod light_accel;
|
||||
mod light;
|
||||
mod math;
|
||||
mod objects_split;
|
||||
mod parse;
|
||||
mod ray;
|
||||
mod renderer;
|
||||
|
@ -40,8 +36,6 @@ mod surface;
|
|||
mod timer;
|
||||
mod tracer;
|
||||
mod transform_stack;
|
||||
mod triangle;
|
||||
mod world;
|
||||
|
||||
use std::fs::File;
|
||||
use std::io;
|
||||
|
|
|
@ -7,11 +7,11 @@ use nom::IResult;
|
|||
|
||||
use camera::Camera;
|
||||
use color::{XYZ, rec709e_to_xyz};
|
||||
use light::WorldLightSource;
|
||||
use math::Matrix4x4;
|
||||
use renderer::Renderer;
|
||||
use world::World;
|
||||
use scene::Scene;
|
||||
use light::WorldLightSource;
|
||||
use scene::World;
|
||||
|
||||
use super::basics::{ws_u32, ws_f32};
|
||||
use super::DataTree;
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
use std::result::Result;
|
||||
|
||||
use assembly::{Assembly, AssemblyBuilder, Object};
|
||||
use scene::{Assembly, AssemblyBuilder, Object};
|
||||
|
||||
use super::DataTree;
|
||||
use super::psy_light::{parse_sphere_light, parse_rectangle_light};
|
||||
|
|
|
@ -10,12 +10,12 @@ use scoped_threadpool::Pool;
|
|||
|
||||
use algorithm::partition_pair;
|
||||
use color::{Color, XYZ, SpectralSample, map_0_1_to_wavelength};
|
||||
use halton;
|
||||
use hash::hash_u32;
|
||||
use hilbert;
|
||||
use image::Image;
|
||||
use math::{fast_logit, upper_power_of_two};
|
||||
use ray::Ray;
|
||||
use sampling::halton;
|
||||
use scene::Scene;
|
||||
use surface;
|
||||
use tracer::Tracer;
|
||||
|
|
6
src/sampling/mod.rs
Normal file
6
src/sampling/mod.rs
Normal file
|
@ -0,0 +1,6 @@
|
|||
pub mod halton;
|
||||
mod monte_carlo;
|
||||
|
||||
pub use self::monte_carlo::{square_to_circle, cosine_sample_hemisphere, uniform_sample_hemisphere,
|
||||
uniform_sample_sphere, uniform_sample_cone, uniform_sample_cone_pdf,
|
||||
spherical_triangle_solid_angle, uniform_sample_spherical_triangle};
|
|
@ -1,11 +1,11 @@
|
|||
use std::collections::HashMap;
|
||||
|
||||
use accel::{LightAccel, LightTree};
|
||||
use accel::BVH;
|
||||
use bbox::{BBox, transform_bbox_slice_from};
|
||||
use boundable::Boundable;
|
||||
use bvh::BVH;
|
||||
use color::SpectralSample;
|
||||
use lerp::lerp_slice;
|
||||
use light_accel::{LightAccel, LightTree};
|
||||
use light::LightSource;
|
||||
use math::{Matrix4x4, Vector};
|
||||
use surface::{Surface, SurfaceIntersection};
|
7
src/scene/mod.rs
Normal file
7
src/scene/mod.rs
Normal file
|
@ -0,0 +1,7 @@
|
|||
mod assembly;
|
||||
mod scene;
|
||||
mod world;
|
||||
|
||||
pub use self::assembly::{Assembly, AssemblyBuilder, Object, InstanceType};
|
||||
pub use self::scene::Scene;
|
||||
pub use self::world::World;
|
|
@ -1,13 +1,13 @@
|
|||
use assembly::Assembly;
|
||||
use camera::Camera;
|
||||
use world::World;
|
||||
use accel::LightAccel;
|
||||
use algorithm::weighted_choice;
|
||||
use transform_stack::TransformStack;
|
||||
use camera::Camera;
|
||||
use color::SpectralSample;
|
||||
use surface::SurfaceIntersection;
|
||||
use math::Vector;
|
||||
use light_accel::LightAccel;
|
||||
use surface::SurfaceIntersection;
|
||||
use transform_stack::TransformStack;
|
||||
|
||||
use super::Assembly;
|
||||
use super::World;
|
||||
|
||||
|
||||
#[derive(Debug)]
|
|
@ -1,5 +1,6 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
mod triangle;
|
||||
pub mod triangle_mesh;
|
||||
|
||||
use std::fmt::Debug;
|
||||
|
|
|
@ -1,16 +1,16 @@
|
|||
#![allow(dead_code)]
|
||||
|
||||
use accel::BVH;
|
||||
use bbox::BBox;
|
||||
use boundable::Boundable;
|
||||
use bvh::BVH;
|
||||
use color::XYZ;
|
||||
use lerp::{lerp, lerp_slice, lerp_slice_with};
|
||||
use math::{Point, Matrix4x4, cross};
|
||||
use ray::{Ray, AccelRay};
|
||||
use shading::surface_closure::{SurfaceClosureUnion, LambertClosure};
|
||||
use triangle;
|
||||
|
||||
use super::{Surface, SurfaceIntersection};
|
||||
use super::triangle;
|
||||
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
@ -1,9 +1,9 @@
|
|||
use std::iter;
|
||||
|
||||
use algorithm::partition;
|
||||
use assembly::{Assembly, Object, InstanceType};
|
||||
use lerp::lerp_slice;
|
||||
use ray::{Ray, AccelRay};
|
||||
use scene::{Assembly, Object, InstanceType};
|
||||
use surface::SurfaceIntersection;
|
||||
use transform_stack::TransformStack;
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user