Add integrators::test_liggting_environment()
Should have been included in an earlier commit.
This commit is contained in:
parent
87f62eedb0
commit
65dd9b5095
|
|
@ -1,6 +1,6 @@
|
||||||
use crate::math::Vec3;
|
use crate::math::Vec3;
|
||||||
|
|
||||||
use super::colour::{Photon, Spectrum};
|
use super::colour::{ColourRgbF, Photon, Spectrum};
|
||||||
use super::raycasting::{IntersectionInfo, Ray};
|
use super::raycasting::{IntersectionInfo, Ray};
|
||||||
use super::sampler::Sampler;
|
use super::sampler::Sampler;
|
||||||
use super::util::algebra_utils::try_change_of_basis_matrix;
|
use super::util::algebra_utils::try_change_of_basis_matrix;
|
||||||
|
|
@ -136,3 +136,13 @@ impl Integrator for SimpleRandomIntegrator {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn test_lighting_environment(w_o: &Vec3, wavelength: f64) -> f64 {
|
||||||
|
let sun_direction = Vec3::new(1.0, 1.0, -1.0).normalize();
|
||||||
|
if w_o.dot(&sun_direction) >= 0.99 {
|
||||||
|
300.0
|
||||||
|
} else {
|
||||||
|
let sky_colour = ColourRgbF::new(w_o.y(), w_o.y(), 1.0) * 0.1;
|
||||||
|
Spectrum::reflection_from_linear_rgb(&sky_colour).intensity_at_wavelength(wavelength)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue