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.
The map of Spyro 1 'Artisans Hub':
./engine ArtisansHub High
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
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