library: render: bidirectional: use progress bar
This commit is contained in:
parent
a50732b998
commit
ce37fcda52
|
@ -8,6 +8,7 @@ use crate::shape::Shape;
|
||||||
use crate::{Point, Vector};
|
use crate::{Point, Vector};
|
||||||
use beevee::ray::Ray;
|
use beevee::ray::Ray;
|
||||||
use image::RgbImage;
|
use image::RgbImage;
|
||||||
|
use indicatif::ProgressIterator;
|
||||||
use nalgebra::Unit;
|
use nalgebra::Unit;
|
||||||
use rayon::prelude::*;
|
use rayon::prelude::*;
|
||||||
|
|
||||||
|
@ -38,7 +39,10 @@ impl BidirectionalPathtracer {
|
||||||
);
|
);
|
||||||
let total = width * height;
|
let total = width * height;
|
||||||
|
|
||||||
|
let p = super::super::progress::get_passes_progressbar(self.scene.shot_rays);
|
||||||
|
|
||||||
let (img_buf, _) = (0..self.scene.shot_rays.max(1))
|
let (img_buf, _) = (0..self.scene.shot_rays.max(1))
|
||||||
|
.progress_with(p)
|
||||||
.map(|_| {
|
.map(|_| {
|
||||||
let mut buffer: Vec<LinearColor> = Vec::new();
|
let mut buffer: Vec<LinearColor> = Vec::new();
|
||||||
buffer.resize_with(total as usize, LinearColor::black);
|
buffer.resize_with(total as usize, LinearColor::black);
|
||||||
|
|
Loading…
Reference in a new issue