Use camera settings from pbrt file

This commit is contained in:
hal8174 2025-09-12 21:58:58 +02:00
parent 6403aabc11
commit 0a9748a1b7
Signed by: hal8174
SSH key fingerprint: SHA256:NN98ZYwnrreQLSOV/g+amY7C3yL/mS1heD7bi5t6PPw
4 changed files with 51 additions and 15 deletions

View file

@ -46,7 +46,7 @@ impl Lexer {
#[derive(Debug)]
#[allow(dead_code)]
enum CameraType {
pub enum CameraType {
Orthographic {
frame_aspect_ratio: Option<Float>,
screen_window: Option<Float>,
@ -64,8 +64,8 @@ enum CameraType {
#[derive(Debug)]
#[allow(dead_code)]
struct PbrtCamera {
camera_type: CameraType,
pub struct PbrtCamera {
pub camera_type: CameraType,
shutter_open: Float,
shutter_close: Float,
}
@ -640,10 +640,9 @@ impl<R: Rng> Pbrt<R> {
}
#[derive(Debug)]
#[allow(dead_code)]
pub struct PbrtWorldSettings {
camera: PbrtCamera,
camera_ctm: AffineTransform,
pub camera: PbrtCamera,
pub camera_ctm: AffineTransform,
}
#[derive(Debug)]
@ -790,7 +789,7 @@ fn inner_parse_pbrt<R: Rng + std::fmt::Debug>(
*context.ctm.last_mut().unwrap() = affine_transform
}
Statement::Shape(shape_type, shape_alpha) => {
dbg!(&context);
// dbg!(&context);
if context.area_light.is_empty() {
pbrt.scene.shapes.push(Shape {
ctm: context.get_ctm(),