fec-canvas-threejs

Installation
SKILL.md

Canvas and Three.js

Purpose

Enable high-performance 2D/3D graphics rendering in the browser.

Procedure

  1. First select the rendering layer: DOM for standard UI; Canvas 2D for simple 2D graphics/signatures/particles; Three.js/WebGL for 3D models, spatial interactions and complex particles; React Three Fiber for declarative 3D in React projects.
  2. Define stable size, DPI adaptation, and resize behavior for the render container; Canvas does not automatically scale cleanly with CSS.
  3. The animation loop uses requestAnimationFrame, which is paused when it is invisible or has no changes, and canceled when it is uninstalled.
  4. Three.js must release geometry/material/texture/renderer and remove event listeners and observers.
  5. Shader/WebGL tasks first identify whether it is an SDF, ray marching, noise, particle, post-processing, multipass or debugging issue, and then decide whether native WebGL2, Three.js ShaderMaterial or R3F is required.
  6. Check the GLSL version, entry function, varying/in-out, texture API, uniform usage and function declaration order when adapting to WebGL2 to avoid white screen leaving only console errors.
  7. Provide aria-label, alternative text or DOM summary for inaccessible graphic content; interactive graphics must have keyboard support.

Core Patterns

Installs
3
GitHub Stars
23
First Seen
May 25, 2026