rtiow: implement EnvMap in parser.

This commit is contained in:
2023-02-15 15:46:23 -08:00
parent 6fbdb49ce1
commit 5f0e7a26dd
3 changed files with 53 additions and 29 deletions

View File

@@ -1,12 +1,12 @@
[scene]
width = 768
height = 768
subsamples = 1000
#subsamples = 1000
[camera]
lookfrom = [0.0, 10.0, 0.0]
lookfrom = [0.0, 10.0, -100.0]
lookat = [0.0, 0.0, 0.0]
fov = 45.0
fov = 45
aspect = 1
aperture = 0.0
focus_dist = 10.0
@@ -22,3 +22,6 @@ radius = 10
[[spheres]]
center = [-30.0, 0.0, 0.0]
radius = 10
[envmap]
path = "/home/wathiede/src/xinu.tv/raytracers/rtiow/renderer/images/52681723945_e1d94d3df9_6k.jpg"

View File

@@ -65,7 +65,7 @@ fn main() -> Result<()> {
let s = std::fs::read_to_string(config)?;
let cfg: Config = toml::from_str(&s)?;
println!("{:#?}", cfg);
cfg.into()
cfg.try_into()?
}
_ => unreachable!(),
};