elenebelocococociiaciaciacia

Real-Time Generative Art with WebGL Shaders

Published August 2025 Generative Art · WebGL · Shaders

This project explores the creation of dynamic, real-time generative art using WebGL shaders. By leveraging GLSL (OpenGL Shading Language) and GPU acceleration, we've developed an interactive art piece that evolves based on mouse movement and time inputs, generating infinite patterns through algorithmic creativity.

🎨

Core Techniques

Procedural pattern generation using mathematical noise functions

Real-time animation through time-based vertex displacement

Interactive elements via mouse position mapping to shader inputs

            // Vertex Shader - Time-Based Animation
precision mediump float;
attribute vec2 a_position;
uniform float u_time;
uniform vec2 u_resolution;
uniform vec2 u_mouse;

void main() {
  // Apply time-based displacement
  float displacement = sin(u_time * 0.001) * 0.05;
  vec2 position = a_position + vec2(sin(u_time), cos(u_time)) * displacement;
  
  gl_Position = vec4(position, 0.0, 1.0);
}
          

Related Experiments

Audio Reactive Visuals

Transform sound frequencies into visual patterns using the Web Audio API and canvas rendering.

View Experiment

Flocking Simulation

A GPU-accelerated particle system that demonstrates emergent behavior through boid algorithms.

View Experiment