Following along with "Ray Tracing in One Weekend" (https://raytracing.github.io) in Zig. Mostly an exericise in learning Zig.
A key difference is that while the original code C++ code avoided
templates completely, I am trying to make all functions generic.
The code might not be particularly idiomatic due to the more-or-less
direct translation from C++, but I have tried to look up and come up
with programming patterns better suited for Zig.
I now see why people complain about C++ templates being Turing complete. Infinite recursion was messing things up, so keeping all structs concrete till I figure out/ read about a different architecture.
- Overview
- Output an Image
- The
vec3
class - Rays, a Simple Camera, and Background
- Adding a Sphere
- Surface normals and Multiple Objects
- Antialiasing
- Diffuse Materials
- Metal
- Dielectrics
- Positionable Camera
- Defocus Blur
- Final Render
- Overview
- Motion Blur
- BVH
- Solid Textures
- Perlin Noise
- Image Texture Mapping
- Rectangles and Lights
- Instances
- Volumes
- A Scene Testing All New Features
- Overview
- A Simple Monte Carlo Program
- 1D MC Integration
- MC Integrations on the Sphere of Directions
- Light Scattering
- Importance of Sampling Materials
- Generating Random Directions
- Orthonormal Bases
- Sampling Lights Directly
- Mixture Densities
- Some Architectural Decisions
- Cleaning up PDF Management
- The Rest of Your LIfe
- Try different polymorphism patterns: see this showtime. Specifically, it would be nicer to do
const s1 = Sphere { ... }; const s1_h = s1.hittable();
instead of themake
thing that we have going on right now - Parallelize
- Load-balancing
- GPU Acceleration? See Mach engine and Zig gamedev scene in general for inspiration maybe?