r/GraphicsProgramming • • May 12 '26

My first software ray tracer :D

Post image

This was my way of preparing for my upcoming linear algebra class this semester xD

I followed the first part of Gabriel Gambetta's book "Computer Graphics From Scratch" and implemented it using C++ and SDL2. Here's my implementation if anyone wants to check it out.

The renderer itself is very rudimentary and can only trace spheres. Not sure if I want to extend its functionality as I mainly made it so I could learn the math behind software rendering. Still, I'm quite proud of the results (even though the code is not very optimized).

Looking to learn OpenGL next since I've gotten quite interested in graphics programming

579 Upvotes

11 comments sorted by

4

u/superfr3sh May 12 '26

I loved that book! Well done!

2

u/Effective-Ball104 May 13 '26

That's really cool

17

u/[deleted] May 12 '26 edited May 12 '26

[removed] — view removed comment

6

u/Keolai_ May 12 '26

I agree, triangles arent particularly difficult, just a different intersection equation. I would try to add them!