WebGL Graphics Projects is a course project for CS360: Introduction to Computer Graphics, conducted during the 2024-25 Semester I under the guidance of Prof. Soumya Dutta.
This repository is a curated collection of assignments designed to explore the power of WebGL in creating dynamic and interactive graphics. It spans a range of topics from basic 2D animations to advanced ray tracing techniques, offering hands-on experience with:
- WebGL programming and optimization.
- Shader development (GLSL).
- Realistic lighting and shading models.
- Interactive and visually stunning 2D and 3D graphics.
Each assignment is crafted to build a deep understanding of graphics programming, making this repository an excellent resource for both beginners and advanced learners.
Objective:
Dive into the basics of WebGL by creating simple 2D animations, including initializing the WebGL context and rendering basic shapes.
Key Features:
- Setting up the WebGL rendering context.
- Writing vertex and fragment shaders for 2D rendering.
- Animating shapes using
requestAnimationFrame. - Interactive controls for rendering modes (point, wireframe, solid).
Files:
index.htmlscript.jsglMatrix-0.9.5.min.js
Objective:
Learn the fundamentals of 3D graphics by implementing shading techniques and texture mapping.
Key Features:
- Creating and manipulating 3D models.
- Implementing flat shading, Gouraud shading, and Phong shading.
- Texture and environment mapping.
- Responsive design for multi-device compatibility.
Files:
index.htmlscript.jsstylesheet.cssglMatrix-0.9.5.min.js
Objective:
Simulate realistic lighting and shadows using ray tracing techniques.
Key Features:
- Implementing basic ray tracing algorithms.
- Calculating ray-object intersections.
- Rendering scenes with realistic lighting and shadows.
- Optimizing performance for large scenes.
Files:
index.htmlray_tracing.js- Additional assets.
Objective:
Create a stylized, cartoon-like appearance for 3D models using cel shading.
Key Features:
- Custom shaders for cel shading.
- Adding outline effects for enhanced edge visibility.
- Adjustable shading and outline parameters.
- Interactive controls for real-time shading adjustments.
Files:
index.htmlcelShading.jswebgl-utils.jswebgl-debug.jsstylesheet.css- Model files in
.jsonformat.
Objective:
Enhance ray tracing with advanced features for a more realistic rendering experience.
Key Features:
- Recursive ray tracing for reflections and refractions.
- Phong illumination model for realistic lighting.
- Support for multiple light sources and soft shadows.
- Performance optimizations for handling complex scenes.
Files:
index.htmladvanced_ray_tracing.js- Additional enhanced resources.
- WebGL 2.0: For rendering high-performance 2D and 3D graphics.
- JavaScript: Core language for WebGL programming.
- glMatrix: High-performance library for matrix and vector operations.
- HTML5 & CSS3: For web structure and styling.
- GLSL: Custom shaders for vertex and fragment transformations.