diff --git a/src/color.rs b/src/color.rs index 360bb84..e2b2e35 100644 --- a/src/color.rs +++ b/src/color.rs @@ -397,14 +397,6 @@ impl XYZ { XYZ { x: x, y: y, z: z } } - pub fn from_tuple(xyz: (f32, f32, f32)) -> XYZ { - XYZ { - x: xyz.0, - y: xyz.1, - z: xyz.2, - } - } - pub fn from_wavelength(wavelength: f32, intensity: f32) -> XYZ { XYZ { x: x_1931(wavelength) * intensity, diff --git a/src/parse/psy_light.rs b/src/parse/psy_light.rs index f23ef54..22c0386 100644 --- a/src/parse/psy_light.rs +++ b/src/parse/psy_light.rs @@ -7,7 +7,6 @@ use nom::{call, closure, tuple, tuple_parser, IResult}; use mem_arena::MemArena; use crate::{ - color::{rec709_e_to_xyz, Color}, light::{DistantDiskLight, RectangleLight, SphereLight}, math::Vector, }; diff --git a/src/parse/psy_surface_shader.rs b/src/parse/psy_surface_shader.rs index ebd1380..c86d370 100644 --- a/src/parse/psy_surface_shader.rs +++ b/src/parse/psy_surface_shader.rs @@ -2,14 +2,11 @@ use std::result::Result; -use nom::{call, closure, tuple, tuple_parser, IResult}; +use nom::IResult; use mem_arena::MemArena; -use crate::{ - color::{rec709_e_to_xyz, Color}, - shading::{SimpleSurfaceShader, SurfaceShader}, -}; +use crate::shading::{SimpleSurfaceShader, SurfaceShader}; use super::{ basics::ws_f32, diff --git a/src/shading/mod.rs b/src/shading/mod.rs index c82c98f..73fab72 100644 --- a/src/shading/mod.rs +++ b/src/shading/mod.rs @@ -10,7 +10,7 @@ use self::surface_closure::SurfaceClosure; pub trait SurfaceShader: Debug + Sync { /// Takes the result of a surface intersection and returns the surface /// closure to be evaluated at that intersection point. - fn shade(&self, data: &SurfaceIntersectionData, time: f32, wavelength: f32) -> SurfaceClosure; + fn shade(&self, data: &SurfaceIntersectionData, time: f32) -> SurfaceClosure; } /// Clearly we must eat this brownie before the world ends, lest it @@ -40,7 +40,7 @@ pub enum SimpleSurfaceShader { } impl SurfaceShader for SimpleSurfaceShader { - fn shade(&self, data: &SurfaceIntersectionData, time: f32, wavelength: f32) -> SurfaceClosure { + fn shade(&self, data: &SurfaceIntersectionData, time: f32) -> SurfaceClosure { let _ = (data, time); // Silence "unused" compiler warning match *self { diff --git a/src/shading/surface_closure.rs b/src/shading/surface_closure.rs index 6699a66..1d01280 100644 --- a/src/shading/surface_closure.rs +++ b/src/shading/surface_closure.rs @@ -210,7 +210,7 @@ mod lambert_closure { } pub fn estimate_eval_over_sphere_light( - color: Color, + _color: Color, inc: Vector, to_light_center: Vector, light_radius_squared: f32, @@ -411,9 +411,9 @@ mod ggx_closure { } pub fn estimate_eval_over_sphere_light( - col: Color, + _col: Color, roughness: f32, - fresnel: f32, + _fresnel: f32, inc: Vector, to_light_center: Vector, light_radius_squared: f32, @@ -548,16 +548,13 @@ mod emit_closure { } pub fn estimate_eval_over_sphere_light( - color: Color, - inc: Vector, - to_light_center: Vector, - light_radius_squared: f32, - nor: Normal, - nor_g: Normal, + _color: Color, + _inc: Vector, + _to_light_center: Vector, + _light_radius_squared: f32, + _nor: Normal, + _nor_g: Normal, ) -> f32 { - // Not using these, silence warning - let _ = (inc, to_light_center, light_radius_squared, nor, nor_g); - // TODO: what to do here? unimplemented!() } diff --git a/src/surface/triangle_mesh.rs b/src/surface/triangle_mesh.rs index 4aa7940..1a4373f 100644 --- a/src/surface/triangle_mesh.rs +++ b/src/surface/triangle_mesh.rs @@ -263,11 +263,7 @@ impl<'a> Surface for TriangleMesh<'a> { // Fill in intersection data isects[r.id as usize] = SurfaceIntersection::Hit { intersection_data: intersection_data, - closure: shader.shade( - &intersection_data, - wr.time, - wr.wavelength, - ), + closure: shader.shade(&intersection_data, wr.time), }; r.max_t = t; }