This directory contains an Odin translation of ssloy's tinyrenderer (software rasterizer).
The goal of this port is to mirror the original C++ pipeline and keep output parity while using idiomatic Odin modules.
main.odin- application entrypoint and Phong shader wiringmath/- vector/matrix math (geometry.hequivalent)image/- TGA image loading/writing and pixel utilities (tgaimage.*equivalent)model/- OBJ parsing + texture loading (model.*equivalent)rasterizer/- camera transforms, z-buffer, triangle rasterization (our_gl.*equivalent)obj/- assets used by the renderer
- OBJ mesh loading (
v,vt,vn, triangulatedf) - TGA texture support (raw and RLE)
- Perspective projection + viewport transform
- Barycentric triangle rasterization with z-buffer
- Tangent-space normal mapped Phong shading
- CPU parallelization in rasterization (OpenMP-style split on x-range)
Render one:
odin run . -collection:tr=. -- ./obj/african_head/african_head.objOr render multiple models in one scene:
odin run . -collection:tr=. -- ./obj/diablo3_pose/diablo3_pose.obj ../tinyrenderer/obj/floor.objThe renderer writes framebuffer.tga in the current directory.
This port has been validated against the C++ reference renderer with hash-equal framebuffer.tga output on representative scenes.