Fixed compiler warnings.
This commit is contained in:
parent
1cd5d28767
commit
8e109efed5
|
@ -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,
|
||||
|
|
|
@ -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,
|
||||
};
|
||||
|
|
|
@ -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,
|
||||
|
|
|
@ -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 {
|
||||
|
|
|
@ -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!()
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user