Skip to content

syby119/CG-projects

Repository files navigation

CG Projects

Introduction

This is the assignments for the Computer Graphics course, through which you'll learn how to:

  • construct the simplest framework for a Computer Graphics program;
  • display geometry and pixel data on the screen;
  • use modern OpenGL API (3.3+);
  • use GLSL, a Shading Language compatible with OpenGL;

This will help you understanding:

  • the basic concepts in Computer Graphics:
    • geometry
    • lighting
    • texture
    • graphics pipleine etc;
  • how GPU works to display a frame on the screen;

Basically, I follow the Learning OpenGL tutorials and refactor the old version assignments in an object oriented way. The students should have some knowledge of modern C++. Don't be panic if you haven't learnt C++ yet. You'll write no more than 20 lines of code for most of the assignments.

You can find more materials on Bilibili

You can also find the reference demos on Github

Get the repository

git clone --depth=1 https://github.com/syby119/CG-projects.git
cd CG-projects
git submodule init
git submodule update

How to run

Preliminaries

  • CMake >= 3.20
  • C++ Compiler supports at least C++14

Build and Compile

cmake -Bbuild .
cmake --build build --config Release --parallel 8

Run

cd build/bin/Release
./pbr_viewer.exe

How to run in Browser

Preliminaries

Switch Branch

git remote set-branches origin web
git fetch --depth=1 origin web
git checkout web

Build and Compile

python build_webassembly.py -Dbuild_web

Run

cd build_web/bin/browser
python run_webassembly.py pbr_viewer.html

Experimental

The experimental branch contains the projects that are not cross-platform and require specfic hardware support. Windows + Nvidia GPU is tested only.

Screenshots

get_start: triangle bonus1: transparency
project1: geometry bonus2: frustum culling
project2: transformation bonus3: post processing
project3: scene roaming bonus4: shadow mapping
project4: instanced rendering bonus5: raytracing
project5: shading tutorial experimental: mesh shading pipeline
project6: texture mapping experimental: spirv dynamic compilation
pbr_viewer: PBR/IBL experimental: direct state access

Platform

Windows 10 WSL 2 Ubuntu 20.04 MacOS Chrome 107 Windows10
get_start
project1
project2
project3
project4
project5
project6
bonus1
bonus2
bonus3
bonus4
bonus5
pbr_viewer
mesh_shading_pipeline
spirv_dynamic_compilation
direct_state_access