56 Commits

Author SHA1 Message Date
2a40258737 chore: Unused imports, use good bounds. 2023-06-04 18:33:23 -05:00
46640d39a1 Feat: Fuzzy metal material
... but something is wrong. The colors. They're not right..
2023-06-04 18:29:18 -05:00
16762906a7 fix: Remaining scanlines, not completed
I forgot I reversed the range. Didn't notice until I tried out a
1920x1080 render and realized it was counting *up* when it said
"remainding."
2023-06-04 16:28:58 -05:00
7926cd2b13 Feat: Materials!
Got the enums to work. This match block is going to be absolutely
massive, but whatever. Current materials are Lambertian and Metal.
2023-06-04 10:31:59 -05:00
d1bde8a1a8 Spurious crashes - Switching to enums
Segfaults and stack overflows. I get overflows when running in either
debug or release. Segmentation faults when hooked up to GDB. I think it
may be related to the copying of uninitialized trait objects, but I
don't know.

I've decided the trait-based interface just isn't worth this. I'll
rearrange the materials into an Enum and a big match block.
2023-06-04 09:19:25 -05:00
5cc0b49cd9 Mid-Material save point
I get lazy with commits when following guided material. There's a design
challenge to approach, now. I'm saving here so I can revert changes in
case it goes sideways.

Materials are proving to be a little complicated in Rust semantics. The
Ray Tracing in a Weekend book uses shared_ptr's, but Rust doesn't really
like that. I'm doing references with lifetime annotations. Hopefully I
can get that the right way around to work out.

The materials themselves look like reasonable candidates for describing
as Enums. This takes away the ability to add new ones by simply impl'ing
a trait, but that was never gonna happen anyway. The code would be
modified and recompiled. There's no difference in maintenance cost if
that's a new struct impl'ing a trait, or adding enum members.
2023-06-03 09:48:54 -05:00