Academic / Computer graphicsAcademic project2024–2025

OpenGL 3D Rendering

C++ and OpenGL 3D renderer featuring OBJ/MTL loading, Phong lighting, cubemap environment rendering, HDR offscreen rendering and tone mapping.

OpenGL scene with a textured cube, torus and aircraft model against a snowy cubemap environment.

OpenGL scene with a textured cube, torus and aircraft model against a snowy cubemap environment.

Technologies

  • C++
  • OpenGL 3.3
  • GLSL
  • GLFW
  • GLEW
  • TinyOBJLoader
  • OBJ / MTL
  • HDR FBO
  • Cubemap

What I built

  • OBJ and MTL loading
  • VAO / VBO / IBO rendering
  • sRGB diffuse textures
  • Phong lighting
  • Hemispheric ambient contribution
  • Fresnel-Schlick
  • Rim and back lighting
  • Environment mapping and cubemap skybox
  • ViewProj UBO and orbital camera
  • GL_RGBA16F HDR framebuffer
  • Reinhard tone mapping and gamma correction

Context

An academic C++ project built around OpenGL 3.3 Core Profile and a navigable 3D scene.

Problem

The renderer needed to load OBJ geometry and MTL materials, preserve a linear lighting workflow, render an environment and convert HDR output for display.

Implementation

TinyOBJLoader reads OBJ and MTL assets before geometry is uploaded through VAO, VBO and IBO buffers. Diffuse textures, material coefficients and an orbital camera feed the rendering pipeline.

The shaders combine Phong lighting, hemispheric ambient contribution, Fresnel-Schlick, rim and back lighting, environment mapping and a cubemap skybox.

Technical architecture

View and projection matrices are shared through a ViewProj UBO. The 3D pass renders into a GL_RGBA16F framebuffer, followed by a full-screen post-processing pass.

Key engineering decisions

Diffuse color textures use sRGB formats so shader calculations stay in linear space. Reinhard tone mapping and gamma correction are applied after HDR rendering.

Challenges

The color pipeline has to keep lighting calculations linear while textures arrive in sRGB and final output returns to display space. Environment mapping and post-processing also require clear texture-unit and render-pass ownership.

What I learned

The project connected asset loading, GPU buffer organization, shader lighting, camera state and post-processing in one inspectable rendering pipeline.

Visual evidence

A second orbital-camera view of the textured OpenGL scene and its cubemap environment.