Skip to content

Tolisz/ComputerGraphics_Tessellation

Repository files navigation

Tessellation

example_tessellation.mp4

About project

This is one of the projects created during "Computer Graphics 2" course, specialty CAD/CAM systems design of degree in Computer Science and Information Systems at Warsaw University of Technology.

Project features:

  • Tessellation is used to draw Bézier patches
  • Dynamic LOD based on distance of the camera from the surface.
  • Normal mapping of the tessellated surface.
  • Displacement mapping of the tessellated surface.

Navigation

Camera
LMB camera rotation
RMB camera zoom in/out
Bézier Patch
W turn on/off grid view
F choose Bézier control points' shapes
C show Bézier control points
S turn on/off Phong shading of the surface
Q turn on/off display of 16 Bézier patches
E turn on/off dynamic level of details
T turn on/off surface texturing
R turn on/off normal mapping
D turn on/off displacement mapping

Compilation

The project is written in C++ (OpenGL) using CMake as a build system. It has two configuration CMake options:

Option Description
TESSELLATION_EMBEDDED_SHADERS If ON shader code will be embedded into a resulting app's binary. If OFF shader code will be read from shaders directory, so a binary has to be run from repository root directory.
TESSELLATION_SHOW_DEBUG_CONSOLE If ON - beside app's window - a debug console will be shown on app start up. If OFF only app's window will be shown.

Windows

All subsequent commands should be called from Windows Power Shell.

git clone --recurse-submodules -j8 https://github.com/Tolisz/ComputerGraphics_Tessellation.git
cd ComputerGraphics_Tessellation
cmake -S . -B build -DTESSELLATION_EMBEDDED_SHADERS=ON -DTESSELLATION_SHOW_DEBUG_CONSOLE=OFF
cmake --build build --config Release
.\build\Release\tessellation.exe

Linux

All subsequent commands should be called from terminal. Compilation was checked using g++ (version 11.4.0) and clang++ (version 14.0.0) compilers.

git clone --recurse-submodules -j8 https://github.com/Tolisz/ComputerGraphics_Tessellation.git
cd ComputerGraphics_Tessellation
cmake -S . -B build -DTESSELLATION_EMBEDDED_SHADERS=ON -DTESSELLATION_SHOW_DEBUG_CONSOLE=OFF
cmake --build build --config Release -j 26
./build/tessellation

Used Libraries

Libraries GLFW, GLM, GLI and ImGui are used as submodules located in externals directory. GLAD is used as a generated file from glad web page.

Library Licence
GLFW Zlib
GLM Modified MIT
ImGui MIT
GLAD MIT
GLI Happy Bunny License (Modified MIT)