Skip to content

πŸš€ GLSL-Deep-Dive is my journey into mastering GLSL from scratch! Covering everything from shader fundamentals to advanced 3D effects, mathematics, and Three.js integration. This repo documents my progress, experiments, and projects as I explore the world of real-time graphics. 🎨✨

Notifications You must be signed in to change notification settings

ExploitEngineer/GLSL-Deep-Dive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

9 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

🎨 GLSL‑Deep‑Dive

Welcome to GLSL‑Deep‑Dive, my personal journey to master GLSL (OpenGL Shading Language) from scratch. This repository is a progressive collection of shader experiments, real-time rendering techniques, mathematical visualizations, and Three.js integrations. It serves as both a learning log and a creative playground for everything related to GPU-based graphics programming.


πŸš€ Overview

GLSL (OpenGL Shading Language) is a C-like language that runs directly on the GPU, allowing real-time manipulation of geometry, lighting, and pixels. It forms the backbone of modern 3D rendering pipelines and is used in engines like OpenGL, WebGL, and Three.js.

This project is focused on building an intuitive and visual understanding of:

  • Shader fundamentals (vertex + fragment)
  • GPU pipeline concepts
  • Mathematical foundations (vectors, matrices, trig)
  • Procedural generation (noise, SDFs, patterns)
  • 3D effects (lighting, refraction, raymarching)
  • Three.js integration

🌐 Repository

GitHub Link: ExploitEngineer/GLSL-Deep-Dive


πŸ“‚ Directory Structure

GLSL-Deep-Dive/
β”œβ”€β”€ shaders/           # Raw GLSL experiments
β”‚   β”œβ”€β”€ basics/        # Syntax, colors, gradients, UVs
β”‚   β”œβ”€β”€ noise/         # Perlin, simplex, pseudo-random
β”‚   β”œβ”€β”€ sdf/           # Signed distance functions
β”‚   β”œβ”€β”€ lighting/      # Phong, Lambert, normal maps
β”‚   └── raymarching/   # Volumetrics, reflections, shadows
β”‚
β”œβ”€β”€ projects/          # Interactive demos with Three.js
β”‚   β”œβ”€β”€ water/         # Animated wave simulation
β”‚   β”œβ”€β”€ fire/          # Procedural fire using noise
β”‚   └── scanner/       # Real-time scanline animation
β”‚
β”œβ”€β”€ notes/             # Markdown learning notes
β”‚   β”œβ”€β”€ uv-mapping.md
β”‚   β”œβ”€β”€ raymarching.md
β”‚   β”œβ”€β”€ glsl-cheatsheet.md
β”‚   └── lighting-models.md
β”‚
β”œβ”€β”€ public/            # Assets for live demos
β”œβ”€β”€ src/               # Codebase if using a framework
β”œβ”€β”€ README.md
└── package.json       # If using Vite/Parcel

✨ Goals & Philosophy

  • βœ… Understand the GPU pipeline: How data flows from CPU β†’ Vertex Shader β†’ Rasterizer β†’ Fragment Shader
  • βœ… Learn through play: Build small, visual experiments that demonstrate key principles
  • βœ… Think in visuals: Translate math into graphics β€” vectors, functions, gradients, etc.
  • βœ… Modular exploration: Each concept/directory is self-contained
  • βœ… Document the process: Notes and explanations accompany experiments

πŸ“˜ Key Topics Covered

πŸ”§ GLSL Essentials

  • GLSL syntax, types (vec2, vec3, mat4, etc.)
  • main() in both vertex and fragment shaders
  • Varying variables and interpolated values
  • Uniforms and real-time parameter control

🧠 Math for Shaders

  • Trigonometry for oscillations and patterns
  • UV mapping and coordinate systems
  • Vector operations (dot, cross, normalize)
  • Matrix transformations

🌊 Procedural Graphics

  • Generating Perlin/simplex noise
  • Using Signed Distance Fields (SDFs) to model 2D/3D shapes
  • Creating infinite tiling patterns
  • Polar coordinate manipulation

πŸ’‘ Lighting & Materials

  • Phong and Lambertian lighting models
  • Normal mapping and bump mapping
  • Reflection/refraction techniques
  • Real-time shading of 3D surfaces

πŸ”¦ Raymarching (Advanced)

  • Distance functions for shapes
  • Boolean operations (union, subtract, intersect)
  • Soft shadows, ambient occlusion
  • Reflections, glows, fog, volumetrics

πŸ§ͺ Three.js Integration

  • Using GLSL inside Three.js shaders
  • ShaderMaterial, RawShaderMaterial
  • Handling time, mouse, and custom uniforms
  • Linking fragment shaders to DOM events

πŸš€ Running the Project

Option 1: Run Raw GLSL with HTML Canvas

Basic examples can be opened with a browser:

cd shaders/basics
open index.html

Option 2: Use Three.js + Vite for Projects

git clone https://github.com/ExploitEngineer/GLSL-Deep-Dive.git
cd GLSL-Deep-Dive
npm install
npm run dev

Navigate to http://localhost:5173


Preview Examples

  • πŸŒ€ Animated vortex with dynamic lighting
  • 🌊 Procedural ocean using sin waves
  • πŸ”₯ Noise-driven fire with color gradients
  • πŸ›°οΈ Scanline animation using custom timing
  • 🌐 Raymarched sphere with soft shadows

🀝 Contributing

Want to experiment or share a new shader idea? Fork the repo and submit a PR:

  1. Fork this repository
  2. Create your shader in /shaders/your-topic/
  3. Document your logic in Markdown
  4. Submit a pull request

πŸ“œ License

This project is licensed under the MIT License. Free to use, remix, and learn from.


🧠 Final Words

Shaders are one of the most creative and expressive tools in real-time graphics. This repo is my attempt to learn them deeply, break them down clearly, and document the path as I go. Whether you're new or experienced, I hope this helps spark your own explorations into GPU magic ✨

About

πŸš€ GLSL-Deep-Dive is my journey into mastering GLSL from scratch! Covering everything from shader fundamentals to advanced 3D effects, mathematics, and Three.js integration. This repo documents my progress, experiments, and projects as I explore the world of real-time graphics. 🎨✨

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages