Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
SinclaM committed Sep 13, 2023
2 parents 239f2c3 + 2118d64 commit 1eadc58
Showing 1 changed file with 13 additions and 5 deletions.
18 changes: 13 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ This project is a simple [Zig](https://ziglang.org/) implementation of the ray t

You can find an interactive demo of this ray tracer online at [sinclam.github.io/ray-tracer-challenge](https://sinclam.github.io/ray-tracer-challenge).

<img src=https://github.com/SinclaM/ray-tracer-challenge/assets/82351204/fc5406c2-5929-40a8-b3f1-6bacc19eb55e width=1200>
<img src=https://github.com/SinclaM/ray-tracer-challenge/assets/82351204/d27b09c6-e915-415a-a640-371e10fb9169 width=1200>

## Status

Expand All @@ -29,7 +29,7 @@ You can find an interactive demo of this ray tracer online at [sinclam.github.io
- [x] A1 - Rendering the Cover Image
- [ ] Bonus Chapter - Rendering soft shadows
- [x] Bonus Chapter - Bounding boxes and hierarchies
- [ ] Bonus Chapter - Texture mapping
- [x] Bonus Chapter - Texture mapping


## Examples
Expand Down Expand Up @@ -62,11 +62,19 @@ You can find an interactive demo of this ray tracer online at [sinclam.github.io

<br/><br/>

<img src=https://github.com/SinclaM/ray-tracer-challenge/assets/82351204/f1207f39-abed-4ccf-b7d2-8cc0bd073850 height=800>
<img src=https://github.com/SinclaM/ray-tracer-challenge/assets/82351204/f1207f39-abed-4ccf-b7d2-8cc0bd073850 height=800>

<br/><br/>

<img src=https://github.com/SinclaM/ray-tracer-challenge/assets/82351204/673121c1-905e-4e6f-b6ca-e7eea75c24db width=800>

<br/><br/>

<img src=https://github.com/SinclaM/ray-tracer-challenge/assets/82351204/18d9d37d-a2f6-4e9e-a811-a0ecf5f8d69b width=800>

## Performance profiling

Although the ray tracer is not (yet) heavily optimized (e.g. is does not yet leverage Zig's SIMD builtins),
Although the ray tracer is not (yet) heavily optimized (e.g. it does not yet leverage Zig's SIMD builtins),
it is still very fast—faster in fact on a single thread than almost every other Ray Tracer Challenge implementation
on multiple threads I've compared with. And there is still significant room for optimization.

Expand All @@ -75,7 +83,7 @@ The optimizations I do make are largely informed by profilers. When built for na
[Valgrind's troubled state on macOS](https://www.reddit.com/r/cpp/comments/13n3tjt/i_find_its_not_possible_to_do_serious_cc_coding/),
combined with [Zig's incomplete Valgrind support](https://github.com/ziglang/zig/issues/1837), means profiling is not
always simple. For example, I've seen Valgrind erroneously run into `SIGILL` and the like. Using `std.heap.raw_c_allocator`
seems to fix most of these issues.
on native seems to fix most of these issues.

The ray tracer currently runs about 2x slower on WebAssembly than on native, which is reasonable. I use Firefox's
"performance" tab in the developer tools for profiling on the web.
Expand Down

0 comments on commit 1eadc58

Please sign in to comment.