Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Running program

Make sure SDL2 and SDL2_ttf are installed

brew install sdl2
brew install sdl2_ttf

To run and compile the engine run bash build.sh {object name} {texture name} or to just run the compiled engine run ./engine {object name} {texture name} where the object name must be present in assets/objects and the texture must be present in assets/sprites.
If no texture name is provided, then the rendered object will be textureless.
If no object name is provided, then the Tree object will be rendered textureless.\

Currently the makefile is not os-agnostic, so it should only work for arm macs.

Recommended to see capabilities

The map of Spyro 1 'Artisans Hub':

./engine ArtisansHub High

Controls

WASD to move player
Arrows to angle camera
P for normal view
O for depth view (currently too bright)
I for mesh view
U to enable/disable GUI

Functionality

SDL2 is only linked to draw pixel buffers to screen, the processing of those pixel buffers are done by the program
SDL2_ttf is only linked to draw the GUI to screen

This 3D engine is built around the basic graphics pipeline:
View Transform -> Triangle Clipping -> Projection Transform -> Viewport Transform -> Rasterization which is all done by the CPU, including rasterization.
The shading is face normal shading, explaining its roughness.
The meshes are loaded through a primitive .obj loader. This loader is capable of loading vertices, vertex normals, texture coordinates, and n-sided faces.
Textures are loaded

Screenshots

Normal view
Artisans Hub with High texture Screenshot 2024-07-27 at 20 14 46 Airboat

Mesh view

Artisans Hub mesh Airboat Mesh Screenshot 2024-07-27 at 20 05 44

Depth view

Screenshot 2024-07-27 at 20 13 20 Screenshot 2024-07-23 at 15 20 00

About

CPU-based 3d engine with c and SDL2, barebones.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages