Computer Graphics Demos
Interactive WebGL2 examples showing the principles and calculations behind rendering.
Example 1: GL Shaders
Vertex Shader
Model → World → View → Clip transforms, rotation and projection matrices. Flat colors, no lighting.
geometryFragment Shader
Per-pixel Blinn-Phong lighting: ambient, diffuse and specular terms.
lightingCombined Demo
Both shaders together with live source code and matrix values.
full pipelineExample 2: Donut 3D Textures
A: UV Image Textures
Dough, icing and chocolate layers sampled through UVs. Filtering, mipmaps, tiling, alpha layering and normal mapping.
texture2DB: Procedural Textures
The same donut textured by noise, fbm and masks computed in the shader, with displacement and bump mapping.
noiseExample 3: Loading a Model
Ice Cream Van (GLB)
A hand-written GLB parser: chunks, accessors and buffer views, an embedded PNG texture and 32-bit indices.
glTF2D Picture → 3D Asset
Estimate depth from a photo, displace a grid into a textured relief, tear it at object edges and export it as GLB.
depthCar with a 2D UV Atlas
Build a car from boxes and cylinders in code, unwrap every face into one painted texture atlas and see the UV layout.
UV atlas飛行模擬器 Flight Simulator
Fly a jet over a Hong Kong-style harbour city. Lift/drag/stall physics, jet exhaust and afterburner particles, sunny, cloudy and rain weather.
physics香港電車 #80 Tram Street
A UV-textured double-decker tram in the "City of Charm" livery on a sakura-lined street with The Pawn, neon signs and the Bank of China Tower.
UV atlasMS-06S 夏亞專用渣古 II
A Meshy AI image-to-3D model: a million-vertex GLB with base colour, metallic-roughness and normal maps, lit in a studio with shadows.
PBR