Change testscene interface

This commit is contained in:
hal8174 2025-01-02 23:17:17 +01:00
parent 829476c602
commit 0b3daf9441
12 changed files with 313 additions and 223 deletions

View file

@ -7,7 +7,7 @@ use ray_tracing_core::{
scene::Scene,
};
use ray_tracing_renderer::path_tracer_importance::PathTracerImportance;
use ray_tracing_scene::examples::basic_cornell;
use ray_tracing_scene::examples::{basic_cornell, ExampleScene};
use rayon::prelude::*;
use std::path::Path;
@ -45,18 +45,18 @@ fn render_image<
fn main() -> ImageResult<()> {
// let s = BasicScene::new();
let s = basic_cornell::scene();
let s = basic_cornell::BasicCornell::new();
let c = BasicCamera::from_look_at(
400,
400,
s.camera_pos,
s.camera_look_at,
s.camera_up,
s.horizontal_fov,
s.get_camera_pos(),
s.get_camera_look_at(),
s.get_camera_up(),
s.get_horizontal_fov(),
);
let r = PathTracerImportance::new(400, 400);
render_image(&r, &(s.scene)(), &c, "test.exr", 1048)
render_image(&r, &s.get_scene(), &c, "test.exr", 1048)
}