This is a base repository for the rendering track of DH2323 Computer Graphics and Interaction.
The repository is meant to provide a simple API to be able to write pixels to a window. Ultimately, we want to make it easy for both students and TAs in DH2323 to get started with the labs, so that more time can be put into what the students are meant to learn. The purpose of the labs is to get familiar with the fundamentals of ray-tracing and rasterization, the purpose is not to spend time on linking libraries and building boilerplate code to set up a window or a graphics context.
- CMake (Minimum version 3.2)
git clone --recurse-submodules https://github.com/raaavioli/Rendering-fundamentals
cd Rendering-fundamentals && mkdir build && cd build && cmake ..
CMake will generate a Makefile.
make
Which produces a binary bin/DH2323_Rendering
.
If you miss any dependencies for your system see: https://www.glfw.org/docs/3.3/compile.html#compile_cmake
For Debian + Ubuntu:
sudo apt install xorg-dev
make
Which produces a binary bin/DH2323_Rendering
.
When building, CMake will generate a visual studio solution DH2323_Rendering.sln
in the current build
directory.
- Open
build/DH2323_Rendering.sln
- Find DH2323_Rendering in the Solution Explorer
- Right click -> Set as Startup Project
- Build -> Build Solution
The repo has currently been verified to work on:
- Windows 10 with VS2022 and VS2019
- MacOS Big Sur (M1-chip)
- Ubuntu 20.04.3 LTS
More operating systems will be added as they are verified, and the goal is to support a wide range of operating systems so that students can run from any environment.
To use the tool, one creates a class deriving from Scene (see scene.h, example_scene.h and example_scene.cpp). The created Scene subclass needs to be included into main.cpp, and added to the list of scenes at the top of the main()-function.
This way, all Scenes are selectable from the graphical settings-panel when running the program. The general approach for solving a lab assignment is to create a Scene, and implement Update, Draw and DrawGUI to output imagery in line with the assignment specification.
Lab document: https://www.overleaf.com/read/kqpqdndnpcgd