top of page

Course

QMUL Computer Graphics (ECS610U), Fall 2025

 

Completed: December 2025

 

Graphics API: WebGL 1.0, GLSL ES 1.0

 

Platform: Web browser

 

Role: Graphics programmer (solo coursework)

​

Software Used: JavaScript, GLSL, VS Code

Textures & Skyboxes covers everything that happens once an image is sampled inside a shader: UV-mapped textures with proper filtering, a cubemap skybox, reflection mapping, and a set of color and post-processing effects written in the fragment shader.

 

The final scenes use real cubemaps photographed around the Queen Mary campus. A chrome sphere reflects the surrounding buildings and sculpture, and a gamma curve on the reflection pushes the contrast so the bottom of the sphere reads as more grounded. Below, the 1st image is the render with the rendered sphere overlapping the real one the second image is the original.

​

Every effect on this page is a few lines of GLSL running per pixel. JavaScript only handles setup: loading images, binding texture units and toggling render modes.

​

​

Overview:

What I Did:

​

  • Set up texture units, samplers and mipmapped trilinear filtering in WebGL

  • Visualized UV coordinates as color to debug texture layout

  • Built a cubemap skybox and world-space reflection mapping​

  • Wrote gamma, alpha-from-luminance, color inversion and vignette effects as fragment-shader functions

  • Loaded real photographic cubemaps and added a wireframe render toggle

  • Documented every step in a written lab report with renders and code excerpts

Chrome sphere reflecting a real cubemap photographed on the Queen Mary campus
Lit sphere blending diffuse shading with reflections of a real campus cubemap
Textured cow model blending its lighting with a cubemap reflection inside a checkerboard skybox
About

How it works:

Rendering UV coordinates directly as color shows how the cow's texture space is laid out: red increases with s and green with t, so the dark head sits near the origin and the bright green legs sit high in t. Switching the filter from LINEAR_MIPMAP_LINEAR to NEAREST on a high-frequency stripe texture shows why mipmaps matter: with nearest-neighbor sampling, many texels compete for each pixel and the surface breaks up into moiré patterns.

​

The skybox is drawn first with depth testing turned off so it always sits behind the scene, then depth testing is turned back on for the model. Reflections come from reflecting the view vector about the normal, transforming it back to world space with the inverse view matrix and sampling the cubemap. The final color blends ambient, diffuse, specular and 10 percent reflection.

​​

Post effects frag shader as small functions. They invert RGB, deriving alpha from luminance with smoothstep (discarding back faces to avoid depth-sorting artifacts), a gamma curve split down the middle of the screen for comparison, and a radial vignette that darkens the corners to 30 percent.

Cow model with its UV coordinates rendered as red and green color
High-frequency stripe texture sampled with NEAREST filtering, breaking up into moire patterns
My Role
bottom of page