Install
openclaw skills install @bovinphang/fec-canvas-threejsUse when building or reviewing Canvas 2D, Three.js/WebGL, React Three Fiber, GLSL shaders, ShaderToy-to-WebGL adaptation, 2D/3D visualization, game rendering, animation loops, GPU resource cleanup, or rendering performance. Do not use for standard DOM UI, charts already covered by a chart library, o
openclaw skills install @bovinphang/fec-canvas-threejsEnable high-performance 2D/3D graphics rendering in the browser.
requestAnimationFrame, which is paused when it is invisible or has no changes, and canceled when it is uninstalled.aria-label, alternative text or DOM summary for inaccessible graphic content; interactive graphics must have keyboard support.const dpr = Math.min(window.devicePixelRatio || 1, 2);
canvas.width = width * dpr;
canvas.height = height * dpr;
canvas.style.width = `${width}px`;
canvas.style.height = `${height}px`;
ctx.scale(dpr, dpr);
let animationId = 0;
function animate() {
animationId = requestAnimationFrame(animate);
renderer.render(scene, camera);
}
return () => {
cancelAnimationFrame(animationId);
geometry.dispose();
material.dispose();
renderer.dispose();
};
Load references/rendering-patterns.md when it comes to Canvas 2D drawing, animation loops, Three.js scene building, React Three Fiber, InstancedMesh, and performance cleanup.
Load references/shader-webgl-patterns.md when it comes to shader routing, WebGL2 adaptation, GLSL debugging, multi-pass budgeting, and visual verification.
dispose() will cause GPU memory leaks.2D/3D scenes are crisp, responsive, cleanable, and close to 60fps on key devices; users can understand/operate with core content via alt text or keyboard paths.