aboutsummaryrefslogtreecommitdiff
path: root/src/material/dielectric.rs
diff options
context:
space:
mode:
authorJulian T <julian@jtle.dk>2021-08-01 23:24:44 +0200
committerJulian T <julian@jtle.dk>2021-08-01 23:24:44 +0200
commit13e018067631a7401df5b232f95f3d1f7a0cd75c (patch)
tree2c91fe273cfeab48548ffb77c3392bdbdad650a5 /src/material/dielectric.rs
parent86ad7845219e8db06fe47b62794180e1b40f90a5 (diff)
Readd reflective material
Diffstat (limited to 'src/material/dielectric.rs')
-rw-r--r--src/material/dielectric.rs5
1 files changed, 1 insertions, 4 deletions
diff --git a/src/material/dielectric.rs b/src/material/dielectric.rs
index 41f47c2..c8dc279 100644
--- a/src/material/dielectric.rs
+++ b/src/material/dielectric.rs
@@ -3,15 +3,12 @@ use crate::core::{min, Vector3f, Spectrum, Ray};
use crate::world::Intersection;
use crate::sample::Sampler;
use crate::Float;
+use crate::material::reflectant::reflect;
pub struct Dielectric {
ratio: Float,
}
-fn reflect(v: Vector3f, n: Vector3f) -> Vector3f {
- v - n * (2.0 * v.dot(&n))
-}
-
// Implementation from RTIOW
fn refract(v: Vector3f, n: Vector3f, r_ratio: Float, cos_theta: Float) -> Vector3f {
let r_perp = (v + n * cos_theta) * r_ratio;