This project was done for the ISART Digital school by Rémi Serra and Alexandre Perché.
The end goal of the project was to create a program that renders objects in 3D, computes lighting, and has a camera from which the scene is viewed. This is all done on one CPU thread, so the performance isn't ideal, although the code is somewhat optimised.
- Rasterization of triangles in 3D space.
- Drawing functions for:
- Quads
- Cubes
- Subdivided cubes
- Spheres
- Object depth buffer.
- Alpha-blending between objects.
- Back-face culling.
- Object manager to edit the scene's objects in the engine.
- Translation, rotation and scaling using matrices.
- Transformation of vertices through local, world, view, clip, ndc and screen spaces.
- Interpolation of vertex colors.
- Loading textures from .bmp files.
- Perspective-correct application of textures onto objects (nearest-neighboor).
- Applying vertex hues to textures.
- Phong and Blinn-Phong lighting models.
- Materials that dictate how lighting is applied to objects.
- Light manager to edit the scene's lights in the engine.
- Perspective camera.
- 1st and 3rd person view modes.
- Unlit, lit, wireframe and z-buffer rendering modes.
- Controls:
- Press
right click
to take control. - In 1st person:
- use
WASD+shift/space
to move andmouse
to look around.
- use
- In 3rd person (2 options):
- use
mouse
to rotate around the taget point andmouse wheel
to change the camera distance. - use
WASD+shift/space
to rotate around the target point and change the camera distance.
- use
- Press
The following features were not added because of lack of time, or bad compatibility with the current state of the codebase.
- Meshes.
- Anti-aliasing.
- Clipping.
- Execute the
make
command in the project root. - Launch the
Rasterizer
executable file.
- You need to have clang installed (run
clang -v
to check). - Execute
build.bat
to build the project using clang compiler. - Or execute the
make
command in Cygwin. - Launch the
Rasterizer.exe
file.