Commit Graph

11 Commits

Author SHA1 Message Date
309931b7f6 Replace util ctor's with constants
I don't need functions to create new vectors, I just want a constant
that I can clone. The compiler probably does the same thing in both
cases, but this is more semantically accurate to that goal.
2025-08-20 10:31:03 -05:00
46f6784256 Run fixes recommended by cargo-clippy 2025-08-19 18:26:41 -05:00
34a828fe67 autoformat the project 2025-08-19 18:21:51 -05:00
05add1efca Fix imports and Uniform creation usage in rand
Rand v0.9 made the `Uniform::new()` function fallible, but I'm going to
keep assuming these always work and just `.unwrap()` the Result.

It also renamed the distribution module, for some reason.
2025-03-01 12:57:57 -06:00
f03c6280a7 Renderer 2, now with 100% less threading tools
I've rewritten the renderer to see if I can make a better model the
second time around. I was having a rough time untangling parts and
refactoring it piece-by-piece.

Next is to hook up the new rendering parts into a single-threaded
build. Once the parts work again, I can look into thread pooling
machinery.
2023-09-25 08:20:27 -07:00
60b4407573 New Scene struct
The scene is more than just a list of hittables. It's any and all
hittables (so the list, yeah), and also the camera(s!) in the world.

This doens't compile, however. More work will need to be done to
untangle the other things that could previously see these scattered
components.
2023-09-23 14:40:34 -07:00
7c43c3fb82 Rewrite hittable list hit method using iter magic
The loop can go away completely and be replaced with an iterator. Yay
for Rust iterators!
2023-09-23 13:26:42 -07:00
4be7ba54bb Relocate world generation function 2023-09-23 13:07:40 -07:00
515f5b866a Fix: hit record selection mechanism
Because of the mutable record being used in the loop, the previous
version had a somewhat obscured way to track the nearest collision.

Switching to an optional (so I can have a non-optional Material in it)
means I'm not interrogating that value.... So it gets to be explicit
again.

I'll refactor the entire for-loop into an iterator with the min()
adapter at some point. For now: Material lifetimes!
2023-09-23 09:27:21 -07:00
bdc396accf Material references... but bad ordering
It looks like I messed up the preference for the HitRecords. The
geometry bounces correctly, but the record that sticks is not
necessarily the one closest to the camera.
2023-09-22 18:21:12 -07:00
4ce43e12af Gathered up the scene components
After nearly a month of not touching the project, I've finally finished
collecting the scene parts. :l

With that, the rearrange is complete. On to the next thing!
2023-09-17 12:16:33 -05:00