← 返回 Skills 市场
bovinphang

Canvas Threejs

作者 Bovin Phang · GitHub ↗ · v2.5.0 · MIT-0
cross-platform ✓ 安全检测通过
31
总下载
0
收藏
0
当前安装
1
版本数
在 OpenClaw 中安装
/install fec-canvas-threejs
功能描述
Use when building or reviewing Canvas 2D, Three.js/WebGL, React Three Fiber, GLSL shaders, ShaderToy-to-WebGL adaptation, 2D/3D visualization, game rendering...
使用说明 (SKILL.md)

Canvas 与 Three.js

Purpose

在浏览器中实现高性能 2D/3D 图形渲染。

Procedure

  1. 先选渲染层:标准 UI 用 DOM;简单 2D 图形/签名/粒子用 Canvas 2D;3D 模型、空间交互和复杂粒子用 Three.js/WebGL;React 项目中的声明式 3D 用 React Three Fiber。
  2. 为渲染容器定义稳定尺寸、DPI 适配和 resize 行为;Canvas 不会自动随 CSS 清晰缩放。
  3. 动画循环使用 requestAnimationFrame,不可见或无变化时暂停,卸载时取消。
  4. Three.js 必须释放 geometry/material/texture/renderer,并移除事件监听和 observer。
  5. Shader/WebGL 任务先识别是 SDF、ray marching、noise、particle、post-processing、multipass 还是调试问题,再决定是否需要原生 WebGL2、Three.js ShaderMaterial 或 R3F。
  6. WebGL2 适配时检查 GLSL 版本、入口函数、varying/in-out、texture API、uniform 使用和函数声明顺序,避免白屏只留控制台错误。
  7. 对不可访问的图形内容提供 aria-label、替代文本或 DOM 版摘要;交互式图形要有键盘兜底。

Core Patterns

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();
};

Detailed References

涉及 Canvas 2D 绘图、动画循环、Three.js 场景搭建、React Three Fiber、InstancedMesh 和性能清理时,加载 references/rendering-patterns.md

涉及着色器路由、WebGL2 适配、GLSL 调试、多 pass 预算和视觉验证时,加载 references/shader-webgl-patterns.md

Constraints

  • Canvas/WebGL 内容对屏幕阅读器不可见,必须提供替代语义。
  • WebGL 消耗 GPU,低端设备需限制像素比、面数和纹理大小。
  • Three.js 资源不会自动释放,遗漏 dispose() 会造成 GPU 内存泄漏。
  • Canvas 响应式必须同步 CSS 尺寸、绘图尺寸和相机/viewport。
  • 复杂布局/路径规划可联用后台线程 workflow,但渲染本身仍在主线程/渲染线程协调。
  • Shader 主循环、采样层数和多 pass 数量必须有预算;低端设备上要降低 DPR、步数、粒子数或禁用重后处理。
  • 交付前必须确认 canvas 非空、尺寸正确、resize 后不拉伸、控制台无 shader compile/link 错误。

Expected Output

2D/3D 场景清晰、响应式、可清理,关键设备上接近 60fps;用户能通过替代文本或键盘路径理解/操作核心内容。

安全使用建议
This looks safe to install based on the available scan evidence. As with any skill, review its displayed instructions and only provide credentials or local access that clearly match what you expect the skill to do.
能力评估
Purpose & Capability
No supplied artifact or scanner evidence indicates behavior outside the stated OpenClaw skill-version context.
Instruction Scope
SkillSpector reported no prompt-injection, scope-expansion, or unsafe instruction findings to investigate.
Install Mechanism
No install-time persistence, package-script abuse, or unexpected installer behavior was identified from the supplied evidence.
Credentials
No credential, session, profile, or broad local-data access concern was reported or supported by artifact evidence.
Persistence & Privilege
No background worker, privilege escalation, autostart persistence, destructive action, or hidden mutation authority is supported by the available evidence.
如何使用
  1. 确保已安装 OpenClaw(本地或 Docker 部署)
  2. 在对话框中输入安装命令:/install fec-canvas-threejs
  3. 安装完成后,直接呼叫该 Skill 的名称或使用 /fec-canvas-threejs 触发
  4. 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v2.5.0
- Major documentation update: SKILL.md rewritten and expanded for clearer purpose, workflows, and best practices. - Detailed procedures for layer selection, animation management, resource cleanup, and WebGL/GLSL debugging. - Added accessibility and performance constraints specific to Canvas and Three.js/WebGL usage. - Updated code examples for pixel ratio handling and proper animation/resource cleanup. - Now includes references for rendering and shader patterns for advanced use cases.
元数据
Slug fec-canvas-threejs
版本 2.5.0
许可证 MIT-0
累计安装 0
当前安装数 0
历史版本数 1
常见问题

Canvas Threejs 是什么?

Use when building or reviewing Canvas 2D, Three.js/WebGL, React Three Fiber, GLSL shaders, ShaderToy-to-WebGL adaptation, 2D/3D visualization, game rendering... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 31 次。

如何安装 Canvas Threejs?

在 OpenClaw 或 Claude Code 对话框中运行命令「/install fec-canvas-threejs」即可一键安装,无需额外配置。

Canvas Threejs 是免费的吗?

是的,Canvas Threejs 完全免费,采用 MIT-0 许可证,可自由下载、安装和使用。

Canvas Threejs 支持哪些平台?

Canvas Threejs 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。

谁开发了 Canvas Threejs?

由 Bovin Phang(@bovinphang)开发并维护,当前版本 v2.5.0。

💬 留言讨论