gamedevCloudy/rtx-zig
Raytracer in a week(end).
A ray tracer written in Zig
Rays!
Spheres are the only supported primitives. (Can be expanded further)
Anti-aliasing
Materials:
Camera:
SIMD: some linear algebra have been converted into SIMD operstions using builtin functions like muladd
. Note: This proejct can be further sped up using concurrency.
This was my first project in Zig. Coming from a background in gamedev, graphics have always fascinated me. I had been following ZigInDepth series on YouTube to learn Zig, but after some time it got a little boring since it does not have any projects. Jose teaches the concepts very well in the series.
I was able to follow the first video in raytracing series. This allowed me to pick up concepts which I didn't know and also showed me design choices to be made when working or translating object oriented code in C++ to Zig. This breaks many patterns from my time using Unity, and later python which I currently use at my AI Engg job.
I was able to pick up many concepts on my own after section 7.
Learning Approach:
Overall it was pretty fun and enjoyable to make something like this. I look forward to continuing the books (there are 3) if I get free time. Thanks!
.ppm
files which also save the moments of progress - sentimental value, since I know I would not be able to recover those over time. color.zig
, to keep the color related utility seprate. This required me to do .{ .data = {some_vector}}
to get a color but I've stuck to it. deg
to rad
. I've skipped correcting this since I continued past half the day-2 stream on my own.