Inspiration
Our project ‘Killer Renderer of Advanced Interactive Graphics’ (aka. KRAIG) is a 3D modelling software inspired by vintage 3D games such as those on the first Playstation. We created an early version of this which would be able to be developed into a more complex game engine.
What it does
It converts 3D images, made up of triangles, and translates them into a 2D form which can be projected onto a computer screen. The user is able to manipulate the “camera” to view the models from various angles.
How we built it
We built it in C using the theory and mathematics (Linear Algebra) behind 3D graphics engines.
Challenges we ran into
Limited support for Object file
Object file can have different surface polygons (4 or 6 vertices per surface), however our engine assume the surface defined only have 3 vertices. Solution: We needed to triangulate the model as we could only support rendering triangles with the help of Blender.
Perspective correction mapping
Problem: Without correction, texture mapping in 3D graphics using linear interpolation in screen space causes distortion because it doesn't account for depth, making textures look warped. Solution: Perspective correct texture mapping interpolates texture coordinates in perspective (depth) space instead of screen space, ensuring textures appear correctly on 3D surfaces.
Clipping
Problem: Geometry that extends outside the camera's view can cause rendering errors or inefficiencies if not handled. Solution: Clipping removes or trims parts of primitives outside the view frustum, ensuring only visible geometry is processed and rendered correctly.
Z-buffer
Problem: When rendering overlapping objects, it's hard to know which surface should be visible from the camera's point of view. Solution: A Z-buffer stores depth information for each pixel, allowing the renderer to keep only the closest (visible) surface and discard hidden ones.
Accomplishments that we're proud of
- Learning how modern 3D engine works, and the magic (math) behind all of the amazing 3D objects we see day to day.
- Successfully implemented Kraig to work with simple model with minimal help of third-party libraries.
What we learned
By making a simple 3D graphics renderer from scratch in C, we learn the core principles of how 3D objects are represented, transformed, projected, and drawn onto a 2D screen—without relying on external graphics libraries. It also deepens our understanding of low-level math (like matrix operations and vector algebra), memory management, and the graphics pipeline.
What's next for KRAIG
- Optimise the performance with multi-threaded execution
- Better compatability with modern Object file.
- Clean and Optimise the codebase for open-source uses, maybe even make a game with it.
- Interpolate between triangle edges to make the graphic looks smoother.
- World domination, more horizontal rotating kitties and fish on our world (at least in our engine)
Log in or sign up for Devpost to join the conversation.