executable: add bidirectional renderer option
This commit is contained in:
parent
c0fc885159
commit
4bb20e2f30
|
@ -1,4 +1,4 @@
|
||||||
use pathtracer::render::{Pathtracer, Raytracer};
|
use pathtracer::render::{BidirectionalPathtracer, Pathtracer, Raytracer};
|
||||||
use pathtracer::scene::Scene;
|
use pathtracer::scene::Scene;
|
||||||
use std::path::PathBuf;
|
use std::path::PathBuf;
|
||||||
use std::str;
|
use std::str;
|
||||||
|
@ -10,6 +10,7 @@ arg_enum! {
|
||||||
enum RenderOption {
|
enum RenderOption {
|
||||||
Raytracer,
|
Raytracer,
|
||||||
Pathtracer,
|
Pathtracer,
|
||||||
|
Bidirectional,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -40,6 +41,7 @@ fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||||
let image = match options.renderer {
|
let image = match options.renderer {
|
||||||
RenderOption::Raytracer => Raytracer::new(scene).render(),
|
RenderOption::Raytracer => Raytracer::new(scene).render(),
|
||||||
RenderOption::Pathtracer => Pathtracer::new(scene).render(),
|
RenderOption::Pathtracer => Pathtracer::new(scene).render(),
|
||||||
|
RenderOption::Bidirectional => BidirectionalPathtracer::new(scene).render(),
|
||||||
};
|
};
|
||||||
|
|
||||||
image.save(options.output)?;
|
image.save(options.output)?;
|
||||||
|
|
Loading…
Reference in a new issue