GL Engine

GL Engine is a real time graphics engine I built from scratch. It was built as a way of understanding how different lighting and shading algorithms work.


Shader ball with normal and specular maps

Process

This has been an ongoing project since 2017, when I was first learning C++. I found a mentor through Reddit who guided me in setting up the project. With his help and the help of tutorials and documentation, I've slowly built it up to a fully working library that could be used for simple real time graphics applications.

Shader ball with roughness map

Rendering Features

Shading

  • Blinn master shader with texture maps, diffuse, specularity, roughness, etc.
  • Normal mapping
  • Parallax mapping
  • Self illumination shader
  • Multi-sampled, Percentage Closest Filtering (PCF) shadow maps available for all light types
  • Shadow maps from multiple lights simultaneously
  • Image loading for textures
  • 2D text overlay
  • Cubemap environments

Post effects

  • Reinhard and exposure tone mapping of HDR output
  • Deferred rendering
  • Screen space ambient occlusion (Crysis implementation)
  • HDR based glow effect
Shader ball with parallax map

Scene Features

Cameras

  • Target camera for orbiting
  • Free camera
  • Orthographic camera

Lights

  • Directional
  • Point
  • Spot

Meshes

  • Various parametric primitives
  • Custom OBJ loader

Documentation

Documentation is generated automatically on Read The Docs when ever a new commit is pushed. The process consists of two stages.

  1. Doxygen parses the documentation embedded in the C++ files
  2. Sphinx combines the output from Doxygen with custom templates in order to generate documentation in a format that Read the Docs recognises.
Documentation screenshot

Future Improvements

  • Currently the main blinn shader is hard coded in fragment and vertex shader files. In the future I want to create them dynamically so that only the requested features are included in any particular shader instance.
  • Implement physically based rendering.
  • Implement accurate real time fresnel calculations as described by Laurent Belcour at Siggraph2020.
  • Better abstraction for scene objects, to separate them out from rendering objects.

Other Projects