canvas-webgl
HTML5 Canvas 2D and WebGL rendering, animation frames, buffer memory lifecycle, and offscreen workers.
SKILL.mdskills/canvas-webgl/SKILL.md
GitHubCanvas & WebGL Performance Protocol
High-framerate 2D and 3D graphics rendering in browser environments.
1. Render Loop & Animation Frames
- Always drive animations via
requestAnimationFrame(), neversetInterval(). - Calculate delta time (
deltaTime = now - lastTime) to decouple animation speed from screen refresh rates.
2. Memory & Buffer Disposal
- Explicitly dispose of textures, vertex buffers, and shaders when destroying canvas scenes to prevent GPU memory leaks.