Back to Projects

Game / Graphics2025

OpenGL Graphics.

C++OpenGLGLSL

Overview

An OpenGL based C++ graphics engine, implements Phong lighting, texture mapping and interactive scene. Supports multi-shader rendering pipeline, cubemap skybox, post-processing effects in framebuffer, and light positioning and object transformation tool system.

Screenshots

Move Light Tool
01

Move Light Tool

Transform Tool
02

Transform Tool

Water Scene
03

Water Scene

Space Scene
04

Space Scene

Project Metrics

OpenGL

GPU Programming

Phong

Lighting Model

VAO/VBO

Buffer Objects

Framebuffer

Post-Processing

Key Features

01

Phong Lighting

Phong shading per-pixel with ambient, diffuse, and specular values computed in fragment shaders. Light position, color and material specular strength can be configured and adjusted with interactive controls.

02

Hardware-Accelerated Rendering

OpenGL pipeline with Vertex Array Objects (VAOs) and Vertex Buffer Objects (VBOs) to manage efficiently the graphics memory of the GPUs. Optimised draw calls with state management and resource cleanup.

03

Texture Mapping Pipeline

Multi-channel texture support with diffuse and specular map sampling, proper texture unit allocation, and image loading integration for material rendering.

04

Post-Processing Effects

Framebuffer rendering with wave distortion effects and color tinting through fragment shader calculations.

05

GLSL Shader Programming

Custom vertex and fragment shader compilation and linking with uniform variable management for dynamic parameter updates and mathematical lighting calculations.

06

3D Model Loading

OBJ file format support with vertex data parsing such as positions, normals and texture coordinate. Combines with material loading to make full mesh render pipeline.

Architecture

  • OpenGL Pipeline: Hardware-accelerated rendering with Vertex Array Objects (VAOs) and Vertex Buffer Objects (VBOs) for efficient GPU memory management
  • State Management: OpenGL context handling with proper render state transitions and GPU resource optimization
  • Shader Programming: GLSL vertex and fragment shader compilation with uniform variable binding and texture sampler management
  • Texture System: Texture binding with diffuse and specular map support, proper filtering, and image loading integration
  • Rendering Pipeline: Integrated system with color rendering, Phong lighting calculations, skybox environment, and framebuffer post-processing

Challenges & Solutions

Challenge

Optimizing rendering performance with multiple models and textures

Solution

Organized VAO creation and binding to minimize state changes, implemented proper texture unit management, and optimized draw calls to maintain smooth frame rates across different scenes.

Challenge

Managing complex scene rendering with multiple tool modes

Solution

Designed modular scene rendering system supporting different tool modes (Move Light, Transform, Water Scene, Space Scene) with proper state management and resource sharing between modes.

Challenge

Implementing framebuffer post-processing pipeline

Solution

Created framebuffer objects with color and depth attachments, implemented vertex buffer for screen quad rendering, and integrated wave distortion effects with configurable frequency and amplitude parameters.

What I Learned

Learned OpenGL graphics pipeline including vertex array objects, buffer management, and shader programming with GLSL compilation and linking

Gained expertise in Phong lighting model implementation with per-pixel ambient, diffuse, and specular component calculations in fragment shaders

Developed knowledge of texture mapping techniques including multi-channel sampling, proper texture unit binding, and UV coordinate processing

Learned framebuffer operations for post-processing effects including framebuffer object setup and quad rendering for visual effects

Acquired knowledge of 3D mathematics including matrix transformations, vector operations, and lighting equation implementations for realistic rendering

Gained experience with graphics optimization techniques including VAO/VBO state management, draw call efficiency, and GPU memory resource utilization

Future Improvements

TODO 01

Add shadow mapping with depth buffer techniques for realistic shadow casting from dynamic light sources

TODO 02

Implement deferred rendering for efficient multi-light scenarios with G-buffer optimization

TODO 03

Add HDR rendering with tone mapping operators and bloom effects for realistic lighting ranges

Explore more projects