Add initial MIS implementation
This commit is contained in:
parent
ba2d853319
commit
d43d60bb85
10 changed files with 161 additions and 3 deletions
|
|
@ -57,6 +57,12 @@ impl<R: Rng, D: MicrofacetDistribution + Debug + Sync + Send> Material<R> for Mi
|
|||
ray_tracing_core::material::SampleResult::new(w_out, Color::black())
|
||||
}
|
||||
}
|
||||
|
||||
fn pdf(&self, w_in: Dir3, w_out: Dir3) -> Float {
|
||||
let w_h = (w_in + w_out).normalize();
|
||||
|
||||
self.dist.d(w_h)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Debug)]
|
||||
|
|
|
|||
|
|
@ -21,4 +21,10 @@ impl<R: Rng> Material<R> for Mirror {
|
|||
|
||||
ray_tracing_core::material::SampleResult::new(w_out, self.color)
|
||||
}
|
||||
|
||||
fn pdf(&self, w_in: Dir3, w_out: Dir3) -> Float {
|
||||
let _ = w_out;
|
||||
let _ = w_in;
|
||||
0.0
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue