Rendering

Graphics practice from UIUC CS 418: WebGL2 scenes written from scratch, plus software renderers in C.

WebGL2

WebGL2 warmup WebGL2 warmup The first WebGL2 program: an animated line pattern drawn entirely from uniforms. Logo Logo The Illinois "I" built from triangles and animated with matrix transforms. CPU jitter CPU jitter The logo's vertices jittered every frame in JavaScript and re-uploaded to the GPU. GPU jitter GPU jitter The same jitter, moved into the vertex shader so the geometry never leaves the GPU. Psychedelic Psychedelic A full-screen fragment shader animated from a single time uniform. Orbits Orbits A small solar system: a sun, two planets and three moons composed with hierarchical transforms. Lineograph Lineograph An octahedron whose vertices are rewritten on the CPU as you move it around. Terrain Terrain Procedural terrain from repeated random faults, lit with diffuse and specular lighting. Cliffs Cliffs Fault terrain shaded by slope: steep faces render as rock, flat ground as grass. Height map Height map Fault terrain coloured by elevation. Weathering Weathering Fault terrain smoothed by averaging each point with its neighbours, softening the ridges. Textures Textures Fault terrain with a solid colour or an image texture mapped across it. Parametric surfaces Parametric surfaces A UV sphere or torus generated from rings and slices. Flight Flight A free-flying camera over generated terrain. Drive Drive A camera that stays on the ground, following the terrain's height as it moves. Fog Fog Fly-through terrain with distance fog computed in the fragment shader. Spheres Spheres Bouncing spheres with gravity and sphere-to-sphere collisions. Many spheres Many spheres The sphere simulation scaled up, with every sphere drawn as a point sprite in one draw call. Goop Goop An attempt at a fluid-like particle simulation using a spatial grid for neighbour lookups. It never really worked right and I never went back to fix it OBJ viewer OBJ viewer Loads Wavefront OBJ models, computing normals when the file has none, with optional textures.

Software renderers in C