Use camera settings from pbrt file
This commit is contained in:
parent
6403aabc11
commit
0a9748a1b7
4 changed files with 51 additions and 15 deletions
|
|
@ -7,7 +7,7 @@ use ray_tracing_core::{
|
|||
renderer::ClassicalRenderer,
|
||||
scene::Scene,
|
||||
};
|
||||
use ray_tracing_pbrt_scene::parse_pbrt_v4;
|
||||
use ray_tracing_pbrt_scene::{parse_pbrt_v4, CameraType};
|
||||
use ray_tracing_renderer::{
|
||||
depth_renderer::DepthRenderer, mis::MIS, next_event_estimation::NextEventEstimation,
|
||||
path_tracer::PathTracer, path_tracer_importance::PathTracerImportance,
|
||||
|
|
@ -230,15 +230,29 @@ fn main() {
|
|||
}
|
||||
};
|
||||
|
||||
let c = BasicCamera::from_look_at(
|
||||
let fov = match pbrt.settings.camera.camera_type {
|
||||
CameraType::Perspective { fov, .. } => 2.0 * fov,
|
||||
_ => todo!(),
|
||||
};
|
||||
|
||||
let c = BasicCamera::from_affine_transform(
|
||||
args.width,
|
||||
args.height,
|
||||
Pos3::new(3.0, 4.0, 1.5),
|
||||
Pos3::new(0.5, 0.5, 0.0),
|
||||
Dir3::new(0.0, 0.0, 1.0),
|
||||
Float::to_radians(90.0),
|
||||
pbrt.settings.camera_ctm,
|
||||
Float::to_radians(fov),
|
||||
);
|
||||
|
||||
// let c = BasicCamera::from_look_at(
|
||||
// args.width,
|
||||
// args.height,
|
||||
// Pos3::new(-0.3, 0.5, -0.5),
|
||||
// Pos3::new(0.0, 0.75, 0.0),
|
||||
// Dir3::new(0.0, 1.0, 0.0),
|
||||
// Float::to_radians(2.0 * 37.0),
|
||||
// );
|
||||
|
||||
// dbg!(c);
|
||||
|
||||
let s = &pbrt.scene;
|
||||
|
||||
choose_renderer(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue