Photorealistic Rendering

       
Company
   Academic Project
    Engine
   Custom engine based on GLFW
Platform
   Windows PC
    Skills
   C++, OpenGL, GLSL
Role
   Graphics Engineer
    Responsibilities
   Graphics pipeline for loading and rendering

Features

  • Loading and displaying geometry using OpenGL
  • Implementing phong illumination model
  • Dynamic reflection and refraction with environment mapping
  • Hybrid rendering: Deferred + forward shading

Loading & Displaying Geometry

Object data is loaded by my custom phaser from a obj file. After it completes to read all data from a obj file, face and vertex normals are calcuated. The method of calculating vertex normal is a smooth fashion which smoothens face vertexes around one vertex.

Phong Illumination Model

Three types of lighting (spotlight, directional light, point light) on a texture-mapped object.
Dynamic interaction is viable with the following controllable attributes: shader types (phong lighting, phong shading, blinn shading), the three light types, mapping types (spherical, cylindrical, planar), mapping ways (CPU, GPU), mapping entities (positin, normal), number of lights, etc.

Dynamic Reflection & Refraction

1) Reflection and refraction with Fresnel effect.      2) Refraction with air incidence.      3) Refraction with water incidence.
1) A cup with environment map.      2) A complex object with red, blue, green lights.

Hybrid Rendering

It defers most of the heavy rendering (like lighting) to a later stage. The final image comes from G-buffer which is a combined data of position, nomals, albedo, and specular. In this project, final objects are rendered in deferred shading, whereas debug information such as position of lights, normal vectors, and bounding volumes are rendered in forward shading.

Used External Libraries

  • GLEW: The OpenGL Extension Wrangler Library
  • GLFW: An OpenGL library
  • GLM: C++ mathematics library for OpenGL Shading Language
  • PFD: A free C++11 file dialog library
  • STB: Public domain libraries for C/C++
  • ImGui: Bloat-free Immediate Mode Graphical User interface for C++

References

  • learnopengl.com
  • OpenGL Programming Guide: The Official Guide to Learning OpenGL
  • OpenGL SuperBible: Comprehensive Tutorial and Reference