aboutsummaryrefslogtreecommitdiff
path: root/src/camera/film.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/camera/film.rs')
-rw-r--r--src/camera/film.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/camera/film.rs b/src/camera/film.rs
index 3586374..7193e1d 100644
--- a/src/camera/film.rs
+++ b/src/camera/film.rs
@@ -45,7 +45,7 @@ impl Pixel {
}
fn finalize_rgb(&self) -> [u8; 3] {
- let (r, g, b) = self.rgb.to_rgb(255.0);
+ let (r, g, b) = (&self.rgb / (self.samples as Float)).to_rgb(255.0);
[
r as u8,
g as u8,
@@ -128,8 +128,8 @@ impl FilmTile {
}
/// Add a single sample sampled from the scene
- pub fn add_sample(&mut self, point: &Vector2f, c: Spectrum) {
- let point = Vector2i::from(point.floor());
+ pub fn add_sample(&mut self, inp: &Vector2f, c: Spectrum) {
+ let point = Vector2i::from(inp.floor());
// Subtract the offset
let point = point - self.bounds.min;