Skip to content

Commit

Permalink
improved adaptive sampling
Browse files Browse the repository at this point in the history
  • Loading branch information
scott223 committed Dec 7, 2023
1 parent 1d6e51d commit 5d74174
Show file tree
Hide file tree
Showing 10 changed files with 375,452 additions and 32 deletions.
23 changes: 10 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,33 +7,30 @@
Simple Raytracer for simple 3D scenes, made in Rust. Objective is to learn Rust, not make a very good raytracer.

## Ray tracing features
- Monte Carlo raytracer
- anti aliasing using Sobol sequence and MitchellNetravali filter
- weigthed importance sampling using Probability Distribution Functions and attractors (e.g. lights)
- various primitives (triangle, quad, sphere)
- various materials (Lambertian, Metal, Glass, ...)
- Monte Carlo raytracer with adaptive sampling (based on z-test confidence interval)
- Anti aliasing using Sobol sequence and Mitchell Netravali filter
- Weigthed importance sampling using Probability Distribution Functions and attractors (e.g. lights)
- Various primitives (triangle, quad, sphere)
- Various materials (Lambertian, Metal, Glass, ...)
- Bounded Hierarchy Volumes (BHV) tree, constructed using Surface Area Heuristic (SAH), to accelerate intersection tracing
- parallel multi-threaded rendering using Rayon
- shadow acne prevention
- gamma correction
- configurable depth of focus
- scene and configuration input from JSON
- Parallel multi-threaded rendering using Rayon
- Gamma correction
- Configurable depth of focus
- Scene and configuration input from JSON
- ...

![Render example](https://github.com/scott223/raytracer/blob/main/render1200.png?raw=true)
*Render of different objects (cube, sphere, .obj file import (100k triangles) and materials (lambertian, glass, fuzzy metal). This render of 1200x1200 pixels with 2000 samples per pixel took about 30 minutes to complete on MacBook Air M2*


## todo's
- adaptive sampling
- BRDF materials

## Rust learnings applied
- modules, imports, external crates
- ownership/references/borrow, explicit lifetimes
- methods, enums, structs
- generic methods
- Traits
- traits
- basic iterators, match statement
- Result, Error, Option
- reading files, saving files
Expand Down
10 changes: 5 additions & 5 deletions input/config.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"img_width": 600.0,
"img_height": 600.0,
"sample_batch_size": 64,
"max_sample_batches": 120,
"min_sample_batches": 10,
"max_depth": 6,
"sample_batch_size": 20,
"max_sample_batches": 500,
"min_sample_batches": 2,
"max_depth": 8,
"sky_color": {
"r": 0.3,
"g": 0.5,
"b": 0.9
},
"pixel_radius": 2.0,
"bvh_split_method": "SAH",
"gamma_correction": 2.2
"gamma_correction": 2.4
}
374,948 changes: 374,948 additions & 0 deletions input/obj/xl_dragon.obj

Large diffs are not rendered by default.

Loading

0 comments on commit 5d74174

Please sign in to comment.