Sick ass images

This commit is contained in:
STP
2023-12-04 05:34:00 -05:00
parent 5fe2e4a4e6
commit e143a4b2ce
19 changed files with 73 additions and 191 deletions

BIN
img.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 939 KiB

BIN
img/img2.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
img/img3.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 MiB

BIN
img/img4.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 836 KiB

BIN
img/img5.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 MiB

BIN
img/img6.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.2 MiB

BIN
img/img7.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 MiB

BIN
img/img8.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.7 MiB

BIN
img/img9.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.5 MiB

BIN
img2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.6 MiB

View File

@@ -1,35 +0,0 @@
let scene = Scene();
let distance = 3.0;
let falloff = V(0.0,0.0,0.1);
let camera = Camera( P(0.0,0.0,distance), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("+Z Cam", camera);
let camera = Camera( P(0.0,distance,0.1), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("+Y Cam", camera);
let camera = Camera( P(distance,0.0,0.0), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("+X Cam", camera);
let camera = Camera( P(0.0,0.0,-distance), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("-Z Cam", camera);
let camera = Camera( P(0.0,-distance,0.1), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("-Y Cam", camera);
let camera = Camera( P(-distance,0.0,0.0), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("-X Cam", camera);
let height = 4.0;
let spacing = 13.0;
let light = Light(P(0.0,height,spacing), V(0.0,0.3,0.3), falloff);
scene.addLight("blue", light);
let light = Light(P(0.0,height,0.0), V(0.0,0.6,0.0), falloff);
scene.addLight("green", light);
let light = Light(P(0.0,height,-spacing), V(0.3,0.0,0.0), falloff);
scene.addLight("red", light);
let material = Material(V(0.2,0.2,0.2), V(0.2, 0.8, 0.8), 10.0);
scene.addMaterial("bluegreen", material);
let mesh = Mesh("obj/cow.obj", material);
let mesh_node = Node(mesh);
scene.addNode("mesh", mesh_node);
scene

View File

@@ -1,69 +0,0 @@
let scene = Scene();
let material = Material(V(0.9,0.2,0.7), V(0.7, 0.2, 0.7), 10.0);
scene.addMaterial("material", material);
let material2 = Material(V(0.2,0.7,0.2), V(0.7, 0.7, 0.7), 10.0);
scene.addMaterial("mat2", material2);
let camera = Camera(P(0.0,0.0,2.0), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("Cam", camera);
let falloff = V(0.0,0.0,0.0);
let light = Light(P(6.0,6.0,6.0), V(0.4,0.4,0.4), falloff);
light.active(true);
scene.addLight("white", light);
let light = Light(P(2.0,0.0,0.0), V(1.0,1.0,0.0), falloff);
light.active(false);
scene.addLight("green", light);
let light = Light(P(-2.0,0.0,0.0), V(1.0,0.0,0.0), falloff);
light.active(false);
scene.addLight("red", light);
let light = Ambient(V(0.3,0.3,0.3));
light.active(false);
scene.addLight("ambient", light);
let tri = TriangleUnit();
let tri_node = Node(tri, material);
tri_node.active(false);
scene.addNode("tri", tri_node);
let circle = CircleUnit();
let circle_node = Node(circle, material);
circle_node.active(false);
scene.addNode("circle", circle_node);
let cone = ConeUnit();
let cone_node = Node(cone, material);
cone_node.active(false);
scene.addNode("cone", cone_node);
let torus = Torus(0.5, 1.5);
let torus_node = Node(torus, material);
torus_node.active(false);
scene.addNode("torus", torus_node);
let sphere = SphereUnit();
let sphere_node = Node(sphere, material);
sphere_node.translate(0.0,0.0,0.0);
sphere_node.active(false);
scene.addNode("sphere", sphere_node);
let ground = SphereUnit();
let ground_node = Node(ground, material2);
let scale = 2.0;
ground_node.translate(0.0,-scale*2.0,0.0);
ground_node.scale(scale,scale,scale);
ground_node.active(false);
scene.addNode("ground", ground_node);
let mesh = Mesh("obj/cat.obj");
let mesh_node = Node(mesh, material);
mesh_node.active(true);
mesh_node.rotate(0.0,90.0,90.0);
scene.addNode("mesh", mesh_node);
scene

View File

@@ -30,7 +30,7 @@ scene.addLight("green", light);
let colour = V(1.0,0.0,0.0);
let light = Light(pos, colour, falloff);
light.active(true);
light.active(false);
scene.addLight("red", light);
let colour = V(0.7,0.7,0.7);
@@ -91,12 +91,12 @@ rectangle_node1.active(true);
scene.addNode("rectangle1", rectangle_node1);
//Behind wall
let rectangle6 = RectangleUnit();
let rectangle_node6 = Node(rectangle6, white_wall);
rectangle_node6.rotate(0.0, 180.0, 0.0);
rectangle_node6.translate(0.0, 0.0, 1.0);
rectangle_node6.active(true);
scene.addNode("rectangle6", rectangle_node6);
// let rectangle6 = RectangleUnit();
// let rectangle_node6 = Node(rectangle6, white_wall);
// rectangle_node6.rotate(0.0, 180.0, 0.0);
// rectangle_node6.translate(0.0, 0.0, 1.0);
// rectangle_node6.active(true);
// scene.addNode("rectangle6", rectangle_node6);
//Right wall
let rectangle2 = RectangleUnit();

View File

@@ -2,7 +2,6 @@
let scene = Scene();
let distance = 3.0;
let falloff = V(0.0,0.0,0.1);
let camera = Camera( P(0.0,0.0,distance), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("+Z Cam", camera);
let camera = Camera( P(0.0,distance,0.1), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
@@ -16,8 +15,29 @@ scene.addCamera("-Y Cam", camera);
let camera = Camera( P(-distance,0.0,0.0), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("-X Cam", camera);
let kd = V(0.6, 0.3, 0.9); // Diffuse color (white)
let ks = V(0.0,0.0,0.0); // Specular color (no specular reflection)
let kr = V(1.0,1.0,1.0); // Reflection color (no reflection)
let material = Material(kd, ks, kr, 10.0);
scene.addMaterial("mattee", material);
let kd = V(0.3, 0.3, 0.3); // Diffuse color (white)
let ks = V(0.7,0.7,0.7); // Specular color (no specular reflection)
let kr = V(1.0,1.0,1.0); // Reflection color (no reflection)
let material1 = Material(kd, ks, kr, 10.0);
scene.addMaterial("mattee", material1);
let kd = V(0.4, 0.0, 0.8); // Diffuse color (white)
let ks = V(0.0,0.7,0.7); // Specular color (no specular reflection)
let kr = V(1.0,1.0,1.0); // Reflection color (no reflection)
let material2 = Material(kd, ks, kr, 10.0);
scene.addMaterial("reflect", material2);
let height = 4.0;
let spacing = 4.0;
let falloff = V(0.0,0.0,0.01);
let blue = V(0.0,0.0,0.6);
let light = Light(P(0.0,height,spacing), blue, falloff);
scene.addLight("blue", light);
@@ -28,36 +48,43 @@ let red = V(0.6,0.0,0.0);
let light = Light(P(0.0,height,-spacing), red, falloff);
scene.addLight("red", light);
let material = Material(V(0.2,0.2,0.2), V(0.2, 0.8, 0.8), 10.0);
scene.addMaterial("bluegreen", material);
let steiner = Steiner();
let steiner_node = Node(steiner, material);
let steiner_node = Node(steiner, material2);
steiner_node.rotate(90.0,0.0,0.0);
steiner_node.translate(0.0,0.0,1.0);
scene.addNode("steiner", steiner_node);
let steiner2 = Steiner2();
let steiner2_node = Node(steiner2, material2);
steiner2_node.active(false);
scene.addNode("steiner2", steiner2_node);
let crosscap = CrossCap();
let crosscap_node = Node(crosscap, material);
crosscap_node.active(false);
scene.addNode("crosscap", crosscap_node);
let p = 1.0;
let q = 1.0;
let p = 0.9;
let q = 0.1;
let crosscap2 = CrossCap2(p, q);
let crosscap2_node = Node(crosscap2, material);
crosscap2_node.active(true);
crosscap2_node.translate(0.0,0.0,-1.5);
crosscap2_node.rotate(140.0,0.0,90.0);
scene.addNode("crosscap2", crosscap2_node);
let k = 0.5;
let k = 2.0;
let roman = Roman(k );
let roman_node = Node(roman, material);
roman_node.active(false);
scene.addNode("roman", roman_node);
let inner_rad = 1.0;
let outer_rad = 0.5;
let outer_rad = 1.2;
let torus = Torus(inner_rad, outer_rad );
let torus_node = Node(torus, material);
torus_node.scale(0.2,0.2,0.2);
torus_node.rotate(0.0,70.0,0.0);
scene.addNode("torus", torus_node);
scene

View File

@@ -3,30 +3,32 @@ let scene = Scene();
let falloff = V(0.0,0.0,0.0);
//CAMERAS
let camera = Camera( P(100.0,100.0,100.0), P(500.0,500.0,500.0), V(0.0,1.0,0.0));
scene.addCamera("Main Camera", camera);
// let camera = Camera( P(100.0,100.0,100.0), P(500.0,500.0,500.0), V(0.0,1.0,0.0));
// scene.addCamera("Main Camera", camera);
//Light for the sun
let light = Light(P(800.0, 800.0, 250.0), V(1.0, 1.0, 0.929), falloff);
scene.addLight("Sun", light);
// //Light for the sun
// let light = Light(P(800.0, 800.0, 250.0), V(1.0, 1.0, 0.929), falloff);
// scene.addLight("Sun", light);
//Ball for the sun
let material = Material(V(1.0, 1.0, 0.9), V(0.9, 0.9, 0.9), 10.0);
scene.addMaterial("material_sun", material);
let sphere = Sphere(P(800.0, 800.0, 200.0), 50.0);
let sphere_node = Node(sphere, material);
scene.addNode("sphere", sphere_node);
//Ball for the planet
let material = Material(V(0.2,0.8,0.2), V(0.2, 0.8, 0.8), 10.0);
scene.addMaterial("material_planet", material);
let sphere = Sphere(P(500.0, 500.0, 500.0), 50.0);
let sphere_node = Node(sphere, material);
scene.addNode("sphere", sphere_node);
// let sphere = Steiner( material);
// let sphere_node = Node(sphere);
// //Ball for the sun
// let material = Material(V(1.0, 1.0, 0.9), V(0.9, 0.9, 0.9), 10.0);
// scene.addMaterial("material_sun", material);
// let sphere = Sphere(P(800.0, 800.0, 200.0), 50.0);
// let sphere_node = Node(sphere, material);
// scene.addNode("sphere", sphere_node);
// //Ball for the planet
// let material = Material(V(0.2,0.8,0.2), V(0.2, 0.8, 0.8), 10.0);
// scene.addMaterial("material_planet", material);
// let sphere = Sphere(P(500.0, 500.0, 500.0), 50.0);
// let sphere_node = Node(sphere, material);
// scene.addNode("sphere", sphere_node);
let material =
let steiner = Steiner();
let steiner_node = Node(steiner, material);
scene.addNode("sphere", steiner);
scene

View File

@@ -1,34 +0,0 @@
let scene = Scene();
let distance = 3.0;
let falloff = V(0.0,0.0,0.1);
let camera = Camera( P(0.0,0.0,distance), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("+Z Cam", camera);
let camera = Camera( P(0.0,distance,0.1), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("+Y Cam", camera);
let camera = Camera( P(distance,0.0,0.0), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("+X Cam", camera);
let camera = Camera( P(0.0,0.0,-distance), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("-Z Cam", camera);
let camera = Camera( P(0.0,-distance,0.1), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("-Y Cam", camera);
let camera = Camera( P(-distance,0.0,0.0), P(0.0,0.0,0.0), V(0.0,1.0,0.0));
scene.addCamera("-X Cam", camera);
let height = 4.0;
let spacing = 13.0;
let light = Light(P(0.0,height,spacing), V(0.0,0.3,0.3), falloff);
scene.addLight("blue", light);
let light = Light(P(0.0,height,0.0), V(0.0,0.6,0.0), falloff);
scene.addLight("green", light);
let light = Light(P(0.0,height,-spacing), V(0.3,0.0,0.0), falloff);
scene.addLight("red", light);
let material = Material(V(0.2,0.2,0.2), V(0.2, 0.8, 0.8), 10.0);
scene.addMaterial("bluegreen", material);
let sphere = Steiner( material);
let sphere_node = Node(sphere);
scene.addNode("sphere", sphere_node);
scene

View File

@@ -242,13 +242,6 @@ impl Gui {
MAX_DEPTH,
&mut self.raytracing_option.ray_depth,
);
//Epsilon slider
ui.slider(
"Epsilon",
MIN_EPSILON,
MAX_EPSILON,
&mut self.raytracing_option.epsilon,
);
//Ray samples slider
ui.slider(
"Ray Samples",

View File

@@ -252,7 +252,7 @@ impl Ray {
}
match bvh.traverse(self, 0) {
Some((_, intersect)) => {
if intersect.distance < light_distance + EPSILON {
if intersect.distance < light_distance {
return true;
}
}

View File

@@ -37,7 +37,6 @@ pub struct RaytracingOption {
pub pixel_clear: [u8; 4],
pub pixels_per_thread: u32,
pub buffer_proportion: f32,
pub epsilon: f64,
pub buffer_fov: f64,
pub ray_depth: u8,
pub diffuse_rays: u8,
@@ -54,13 +53,13 @@ impl RaytracingOption {
RaytracingOption {
threads: 12,
ray_samples: 1,
ray_randomness: 100.0,
ray_randomness: 700.0,
clear_color: [0x22, 0x00, 0x11, 0x55],
pixel_clear: [0x55, 0x00, 0x22, 0x55],
pixels_per_thread: 1000,
buffer_proportion: 0.1,
pixel_clear: [0x11, 0x00, 0x22, 0x55],
pixels_per_thread: 100,
buffer_proportion: 1.0,
buffer_fov: 70.0,
ray_depth: 5,
ray_depth: 1,
diffuse_rays: 3,
diffuse_coefficient: 0.1,
bvh_active: false,
@@ -69,7 +68,6 @@ impl RaytracingOption {
reflect: true,
specular: true,
falloff: true,
epsilon: 1e-6,
}
}
}