This commit is contained in:
STP
2023-11-28 17:09:50 -05:00
parent 776bfb57f2
commit a831a92232
3 changed files with 23 additions and 20 deletions

View File

@@ -4,13 +4,14 @@ version = "0.1.0"
edition = "2021" edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies] [dependencies]
cfg-if = "1" cfg-if = "1"
env_logger = "0.10" env_logger = "0.10"
log = "0.4" log = "0.4"
pollster = "0.3" pollster = "0.3"
anyhow = "1.0" anyhow = "1.0"
nalgebra = "0.32.3" nalgebra = {version = "0.32.3"}
roots = "0.0.8" roots = "0.0.8"
imgui = "0.11" imgui = "0.11"

View File

@@ -24,12 +24,12 @@ const RAYS_MIN: i32 = 100;
const RAYS_MAX: i32 = 10000; const RAYS_MAX: i32 = 10000;
//MATERIAL CONSTANTS //MATERIAL CONSTANTS
// const MIN_D: f32 = 0.0; const MIN_D: f32 = 0.0;
// const MIN_S: f32 = 0.0; const MIN_S: f32 = 0.0;
// const MIN_SHINE: f32 = 0.0; const MIN_SHINE: f32 = 0.0;
// const MAX_D: f32 = 1.0; const MAX_D: f32 = 1.0;
// const MAX_S: f32 = 1.0; const MAX_S: f32 = 1.0;
// const MAX_SHINE: f32 = 50.0; const MAX_SHINE: f32 = 50.0;
//TRANSFORMATION CONSTANTS //TRANSFORMATION CONSTANTS
const MIN_COLOUR: f32 = 0.0; const MIN_COLOUR: f32 = 0.0;
@@ -287,17 +287,17 @@ impl Gui {
} }
} }
// Edit materials // Edit materials
// if let Some(_t) = ui.tree_node("Materials") { if let Some(_t) = ui.tree_node("Materials") {
// for (label, material) in &mut self.scene.materials { for (label, material) in &mut self.scene.materials {
// if let Some(_t) = ui.tree_node(label) { if let Some(_t) = ui.tree_node(label) {
// ui.slider_config("ks", MIN_D, MIN_D) ui.slider_config("ks", MIN_D, MAX_D)
// .build_array(material.ks.as_mut_slice()); .build_array(material.ks.as_mut_slice());
// ui.slider_config("kd", MIN_S, MAX_S) ui.slider_config("kd", MIN_S, MAX_S)
// .build_array(material.kd.as_mut_slice()); .build_array(material.kd.as_mut_slice());
// ui.slider("fov", MIN_SHINE, MAX_SHINE, &mut material.shininess); ui.slider("shine", MIN_SHINE, MAX_SHINE, &mut material.shininess);
// } }
// } }
// } }
//Edit color, position and falloff of lights //Edit color, position and falloff of lights
if let Some(_t) = ui.tree_node("Lights") { if let Some(_t) = ui.tree_node("Lights") {
for (label, light) in &mut self.scene.lights { for (label, light) in &mut self.scene.lights {

View File

@@ -1,19 +1,21 @@
use crate::state::run; use crate::state::run;
use error_iter::ErrorIter; use error_iter::ErrorIter;
const EPSILON: f64 = 1e-6; const EPSILON: f64 = 1e-8;
const INFINITY: f64 = 1e-10; const INFINITY: f64 = 1e-10;
use log::error; use log::error;
use std::env; use std::env;
use std::error::Error; use std::error::Error;
mod bvh;
mod camera; mod camera;
mod gui; mod gui;
mod light; mod light;
mod material;
mod node;
mod primitive; mod primitive;
mod ray; mod ray;
mod raytracer;
mod scene; mod scene;
mod state; mod state;