[◄]

C:/Users/CRX/Home/Works/Python/Soft_Renderer

SOFTWARE RENDERER

During my computer science class in 2022-2023 I decided it would be pretty fun to try making something resembling a 3d renderer so I looked up a few breakdowns of how DOOM rendered rooms using concave 2d shapes with a floor and ceiling. I thought it would be a fun thing to try out so I put some time into writing one out in python using the pygame library. I decided on python because I'm lazy and don't want to learn C libraries.


After some time figuring things out, I realized I wouldn't be able to finish my actual classwork before I could finish the funny DOOM renderer. So instead I started another project that ended in a raycaster which took about 2 days to finish. It probably wouldn't have been possible without this guide/breakdown from lodev. Sadly I lost the files to both a while back so I can't show them but they were pretty awful anyways, not much you're missing out on.


Because of my newly formed interest in the "3d graphics from scratch" genre of software rendering, it was only a matter of time before I put some time into making a point based system for funsies. I mostly used reference from scratchapixel which has a lot of other really cool graphics related stuff you should check out.


The code itself just barely exceeds 340 lines but runs like dogwater probably due to my impressively bad implementation of everything ranging from not using built in matrix transformations and functions to using lambda to sort a list in reverse or something? Overall I'm still quite proud of myself for being able to understand the fundamentals of 3d euler rotation and matrices in high school though my grades certainly don't reflect that.

a picture of a beautifully rendered cow look at that magestic steed

When making the project I used a few reference models such as the infamous "Utah Teapot" and "Cow.obj", both of which you can find here.


If you want to run the code for yourself, just download from this dropbox. I know, bad website design. You need python 3.x and pygame installed to actually run the program though so get that first.