These programming projects accompany an introductory computer graphics course. They cover 2D raster images, 3D geometry, 3D transformations, ray tracing, and the GPU-accelerated graphics pipeline. The assignments have been tested on Mac, Windows, and Linux.
The courses assume familiarity with basic linear algebra, multivariable calculus, and low-level or systems programming.
- Airbrush: Raster images and compositing.
- Raycasting: Ray tracing and 3D transformations.
- Raytracing: Ray tracing and illumination.
- Image Processing: Image processing.
- Meshes: Mesh processing.
- Shaders aka the Graphics Pipeline: The graphics pipeline and GPU shader programming.
-
All assignments will be written in C++. The assignments should ease you in.
-
You will need a working C++ compiler and the CMake build system. Here are my recommended installation instructions:
-
Ubuntu Linux:
apt-get install build-essential cmake
-
Mac:
-
Windows: There are three ways that should work well:
-
Install Windows Subsystem for Linux. Then follow the Ubuntu Linux instructions above.
-
Miniconda: Choose the 64-bit Python 3.x version. Launch the Anaconda shell from the Start menu and run:
conda install -c conda-forge cmake git cxx-compiler
. -
DIY:
- Install a compiler. It could be Visual Studio, which provides an entire IDE. It could be MinGW. (Visual Studio Code is a nice editor, but doesn't come with a compiler.)
- Install CMake. You must install/reinstall CMake after you install a compiler. The CMake installer discovers available compilers.)
-
-
-
Download each assignment. Inside each folder there is a file named
CMakeLists.txt
.-
You can open it directly with your IDE, if your IDE supports that. (Examples: Visual Studio, Visual Studio Code with the CMake Tools extension, CLion, and Qt Creator.)
-
You can ask
cmake
to generate a build file for your IDE. For example:cmake -B build-xcode -G Xcode
will generate a project for the Xcode IDE on macOS in a folder namedbuild-xcode
.cmake -B build-vs -G "Visual Studio 16 2019"
will generate a project for the Visual Studio 2019 IDE on Windows in a folder namedbuild-vs
.cmake
should find your Visual Studio installation automatically. If it isn't, reinstall cmake (it finds compilers during installation) and make sure you are running from a Visual Studio Developer Command Prompt.
-
If you aren't using an IDE, from inside each folder, run:
cmake -B build
Then, to compile the program, just type
cmake --build build-dir
. There are some useful flags you can pass tocmake
. Try:cmake -B build-dir -DCMAKE_BUILD_TYPE=Debug
to specify compilation with debug information for use with a debugger.cmake -B build-dir -DCMAKE_BUILD_TYPE=Release
to specify compilation of an optimized build. Your code will run much faster.cmake -B build-dir -DCMAKE_BUILD_TYPE=RelWithDebInfo
to specify compilation of an optimized build with debug information. Your code will run much faster, but you will still sort of be able to debug it (compilers move code around when optimizing).
-
-
Build and run the code. Make your changes. Write a
Notes.txt
. Runcpack
(ormake zip
orcmake --build build-dir --target zip
) to generate a.zip
file. Hand in the.zip
file.