Coursework for CS360: Introduction to Computer Graphics (IIT Kanpur).
Author: Pranshu Kumar
All assignments are implemented in WebGL2 / WebGL with plain JavaScript. The only third-party dependency is the glMatrix 0.9.5 matrix-vector library (bundled in each assignment folder); no other libraries are used.
| # | Topic | Key techniques | Folder |
|---|---|---|---|
| 1 | 2D Scene Rendering & Animation | Basic shapes (square / triangle / circle), affine transforms, matrix stack, requestAnimationFrame |
Assignment 1 |
| 2 | 3D Rendering & Shading | Flat, Gouraud (per-vertex) and Phong (per-fragment) shading, multiple viewports, per-viewport mouse interaction | Assignment 2 |
| 3 | Texture Mapping & Cubemap Environment Mapping | Skybox, 2D textures, alpha discard, cubemap reflection & refraction, mesh loading | Assignment 3 |
| 4 | Shadow Mapping (Rasterization) | Two-pass rendering, depth FBO, shadow-map lookup with bias | Assignment 4 |
| 5 | Ray Tracing | GLSL fragment-shader ray tracer, ray-traced Phong, shadows and reflections on spheres | Assignment 5 |
Each folder has its own README.md describing the scene, controls and implementation.
Every assignment is a static web app: open its .html file in a modern browser
(tested in Chrome and Firefox) with WebGL2 support.
Assignments 3 and 4 load external resources at runtime (teapot.json, texture
images), so file:// will be blocked by the browser's CORS policy. Serve the folder
over HTTP instead:
# from inside an assignment folder
python3 -m http.server 8000
# then open http://localhost:8000/<html-file>Assignments 1, 2 and 5 have no external assets and also run fine when opened directly.
CS360/
├── Assignment 1/ 2D_Scene.html, 2D_Scene.js, glMatrix, spec PDF
├── Assignment 2/ shading.html, shading.js, 3D_shape_generation.js, glMatrix, spec PDF
├── Assignment 3/ index.html, scene.js, glMatrix, texture_and_other_files/, spec PDF
├── Assignment 4/ index.html, scene.js, glMatrix, teapot.json, spec PDF
└── Assignment 5/ index.html, scene.js, glMatrix, spec PDF
The Assignment_*.pdf in each folder is the original problem statement.