2025

3D Graphics & Visualization with OpenGL

An interactive 3D scene renderer built with OpenGL and C++ featuring real-time camera controls, lighting systems, and texture mapping to create photorealistic 3D environments

Tech Stack

C++OpenGL 3.3+GLFWGLADGLMGLSLVisual Studio

Context

The Problem

Understanding 3D graphics programming requires mastering complex mathematical transformations, lighting models, and rendering pipelines. This project demonstrates practical application of computer graphics theory through interactive 3D scene creation.

Constraints

  • Real-time rendering at 60+ FPS with multiple textured objects
  • Support for camera movement and rotation controls
  • Implement multiple lighting models (ambient, directional, point)
  • Handle 3D transformations (translation, rotation, scaling) with matrices
  • Maintain clean, modular C++ architecture

Stakes

Academic project for CS-330 (Computer Graphics and Visualization) demonstrating mastery of OpenGL, linear algebra, lighting systems, and real-time rendering techniques

My Role

Title

Graphics Programmer

Team

Academic Project (Individual)

Ownership

Complete implementation of 3D rendering pipeline, shader programs, camera system, lighting, texture management, and scene composition

Approach & Key Decisions

Built a 3D scene renderer using OpenGL with GLFW for window management and GLAD for extension loading, implementing vertex/fragment shaders, camera controls (WASD movement + mouse look), and multiple lighting sources with texture mapping.

OpenGL 3.3+ Core Profile for modern rendering

Core profile enforces modern best practices, eliminates deprecated fixed-function pipeline, and provides better performance through programmable shaders and vertex buffer objects.

GLSL shader programs for vertex and fragment processing

Custom shaders provide full control over vertex transformations and pixel coloring, enabling advanced lighting calculations, texture mapping, and visual effects on the GPU.

GLM (OpenGL Mathematics) for matrix operations

GLM provides GLSL-compatible matrix and vector types in C++, simplifying camera transformations, model-view-projection matrices, and lighting calculations with type-safe API.

GLFW for cross-platform window and input management

GLFW abstracts platform-specific windowing, handles keyboard/mouse input events, and manages OpenGL context creation with minimal boilerplate code.

Phong lighting model with ambient, diffuse, and specular components

Phong lighting provides realistic surface appearance by combining ambient illumination, diffuse reflection based on surface normals, and specular highlights for shiny materials.

Texture mapping with multiple image formats

Textures add photorealistic detail to 3D models without complex geometry. Supporting multiple formats (JPG, PNG) enables diverse material representation like wood, metal, and glass.

Alternatives Considered

Considered using Unity or Unreal Engine but chose raw OpenGL to demonstrate fundamental understanding of graphics programming and rendering pipeline mechanics

Challenges & Solutions

Challenge

Implementing smooth camera movement with WASD keys and mouse look

Solution

Built camera system using view matrix transformations with GLM, handling keyboard input for position updates and mouse delta for rotation, applying frame-rate independent movement with deltaTime calculations.

Challenge

Achieving realistic lighting across multiple object types and materials

Solution

Implemented Phong lighting model in fragment shaders with configurable ambient, diffuse, and specular components. Added support for directional lights and point lights with distance attenuation for depth perception.

Challenge

Managing texture coordinates and preventing distortion on complex shapes

Solution

Calculated proper UV coordinates for each vertex, implemented texture wrapping modes (repeat, clamp), and applied texture filtering (linear, mipmap) to maintain visual quality at different distances.

Challenge

Optimizing rendering performance with multiple textured objects

Solution

Used Vertex Buffer Objects (VBOs) and Vertex Array Objects (VAOs) to minimize state changes, implemented efficient draw calls with glDrawArrays, and batched similar objects to reduce GPU overhead.

Outcomes & Impact

Graphics Expertise

Mastered OpenGL rendering pipeline, shader programming, matrix mathematics, and real-time 3D graphics techniques

Camera System

Fully interactive camera with WASD movement, mouse look rotation, and arrow key controls for exploring 3D scenes

Lighting Implementation

Multi-light system with ambient, directional, and point lights using Phong shading model for realistic illumination

Texture Mapping

10+ unique textures applied to scene objects including wood, metal, glass, and abstract materials

Performance

Consistent 60+ FPS rendering with multiple textured objects and real-time lighting calculations

Code Architecture

Modular C++ design with separated shader management, texture loading, camera logic, and scene rendering

Project Links