Skip to content

danieljake/opengl-klein-bottle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WulineRenderer

What this project is

WulineRenderer is a C++20 GUI application for rendering 3D parametric surfaces with a software raster path and a real-time OpenGL presentation layer.

It was built specifically as a learning project to deeply understand:

  • Real-time OpenGL-driven rendering flow
  • Geometric projection and depth ordering
  • Lighting and material response in interactive 3D scenes
  • Xiaolin Wu's line algorithm for anti-aliased line rasterization in a real UI context

It is intentionally a compact, inspectable graphics codebase rather than a general-purpose rendering engine.

Why this project exists

The core motivation was to practice graphics fundamentals by building a full end-to-end viewer: from raw mesh generation and transformation, through rasterization and shading, to an interactive control UI.
This project is intentionally focused on:

  • Strong rendering clarity with smooth line output (Wu algorithm + custom raster code paths)
  • Performance-aware data flow (projection caching, face sorting, and asynchronous mesh regeneration)
  • A polished, responsive interface for experimenting with shape parameters and lighting
  • Practical experience with native app packaging and macOS signing/runtime behavior

Screenshot

The file in the repository assets directory demonstrates the current visual direction:

WulineRenderer Demo

Features

  • Native macOS GUI (GLUT + OpenGL)
  • Clear separation of responsibilities across SceneViewModel, SceneController, GuiApplication, and Renderer3D
  • Parametric surfaces and controls
  • Adjustable lighting and beam effects
  • Grid overlay and edge highlighting
  • Unit-tested core model/controller and geometry behavior
  • Native .app packaging with icon support (.icns)

Build

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWULINE_ENABLE_GUI=ON
cmake --build build -j4

macOS bundle flow (recommended)

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DWULINE_ENABLE_GUI=ON -DWULINE_BUILD_MACOS_BUNDLE=ON
cmake --build build -j4
cmake --build build --target run_native_app

Deterministic launch check:

cmake --build build -j4 && cmake --build build --target run_native_app_checked

If the launch check fails, re-run with:

xattr -cr build/wulinerenderer.app

Then launch again.

Production-hardening switches:

  • -DWULINE_ENABLE_LTO=ON for release builds (where supported)
  • -DWULINE_ENABLE_SANITIZERS=ON for Address/Undefined behavior hardening in Debug builds on Clang, AppleClang, and GCC

If a newer dependency/toolchain is available in your environment, it is safe to use as long as the system still provides OpenGL/GLUT for the GUI target.

Run options

  • This is a GUI-first application; the main executable launches the interactive viewer
  • Shape presets: cuboid, pyramid, ellipsoid, parallelogram, klein, projective, roman, boy
  • Supported startup flags: --shape <name>, --no-beam, --shape-width, --shape-height, --shape-depth, --light-x, --light-y, --light-z

Testing

ctest --test-dir build --output-on-failure

Sanitized pipeline:

cmake -S . -B build-sanitized -DCMAKE_BUILD_TYPE=Debug -DWULINE_ENABLE_GUI=ON -DWULINE_ENABLE_SANITIZERS=ON
cmake --build build-sanitized -j4
ctest --test-dir build-sanitized --output-on-failure

GitHub Actions runs:

  • Release GUI builds on macos-latest and ubuntu-latest
  • Debug sanitized builds on macos-latest and ubuntu-latest

License

MIT License (c) 2025 Daniel Jake.
See LICENSE.

Credits

Created as a graphics learning project focused on OpenGL and Wu line-based rendering.

About

An OpenGL application for visualising 3D non-orientable parametric surfaces with geometric projection, interactive lighting, and Xiaolin Wu anti-aliased line rasterization.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors