Token导航 LogoToken导航TokenDH.com
研究检索需要联网github未标认证来源可访问clear审计未展示

three-jsThree.js 搜索

Agent Skill

three-js 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

315

周安装

13

GitHub Stars

公开资料未说明

下载量

103
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

MIT

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:three-js(Three.js 搜索)
来源仓库:https://github.com/5dlabs/cto
仓库路径:skills/three-js
安装命令:
npx skills add 5dlabs/cto --skill "three-js"
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

AgentSkills.tonpx skills
npx skills add 5dlabs/cto --skill "three-js"

简介

用于查找 Three.js 相关技术资料与最佳实践方案。

  • 适合前端开发者在使用 WebGL 进行 3D 可视化时参考。
  • 支持 Codex、Claude、Cursor、Gemini CLI 等主流开发工具。
  • 通过关键词检索快速定位文档、教程或开源项目案例。
  • 建议结合官方手册验证信息准确性,避免过时内容误导。

SKILL.md

Three.js Best Practices

Comprehensive performance optimization guide for Three.js applications with 100+ rules across 17 categories.

When to Apply

Reference these guidelines when:

  • Setting up a new Three.js project
  • Writing or reviewing Three.js code
  • Optimizing performance or fixing memory leaks
  • Working with custom shaders (GLSL or TSL)
  • Implementing WebGPU features
  • Building VR/AR experiences with WebXR

Rule Categories by Priority

PriorityCategoryImpactPrefix
0Modern Setup & ImportsFUNDAMENTALsetup-
1Memory Management & DisposeCRITICALmemory-
2Render Loop OptimizationCRITICALrender-
3Geometry & Buffer ManagementHIGHgeometry-
4Material & Texture OptimizationHIGHmaterial-
5Lighting & ShadowsMEDIUM-HIGHlighting-
6Scene Graph OrganizationMEDIUMscene-
7-8Shader Best PracticesMEDIUMshader-, tsl-
9-17Loading, Camera, Animation, Physics, WebXR, Audio, Mobile, Production, DebugVARIES-

Quick Reference

Modern Import Maps

<script type="importmap">
{
  "imports": {
    "three": "https://cdn.jsdelivr.net/npm/three@0.182.0/build/three.module.js",
    "three/addons/": "https://cdn.jsdelivr.net/npm/three@0.182.0/examples/jsm/",
    "three/tsl": "https://cdn.jsdelivr.net/npm/three@0.182.0/build/three.tsl.js"
  }
}
</script>

Memory Management (CRITICAL)

Always dispose resources:

function disposeObject(obj) {
  if (obj.geometry) obj.geometry.dispose();
  if (obj.material) {
    if (Array.isArray(obj.material)) {
      obj.material.forEach(m => m.dispose());
    } else {
      obj.material.dispose();
    }
  }
}

// Recursive disposal for hierarchies
function disposeHierarchy(obj) {
  obj.traverse(child => disposeObject(child));
}

Render Loop (CRITICAL)

// Use setAnimationLoop, not manual RAF
renderer.setAnimationLoop(animate);

// Never allocate in render loop
const _tempVector = new THREE.Vector3();  // Reuse outside loop

function animate(time) {
  // Use cached objects
  _tempVector.set(0, 1, 0);

  // Use delta time for animations
  const delta = clock.getDelta();
  mixer.update(delta);

  renderer.render(scene, camera);
}

Geometry (HIGH)

// Use InstancedMesh for identical objects
const mesh = new THREE.InstancedMesh(geometry, material, count);
const matrix = new THREE.Matrix4();

for (let i = 0; i < count; i++) {
  matrix.setPosition(positions[i]);
  mesh.setMatrixAt(i, matrix);
}
mesh.instanceMatrix.needsUpdate = true;

Materials & Textures (HIGH)

// Reuse materials
const sharedMaterial = new THREE.MeshStandardMaterial({ color: 0xff0000 });

// Use compressed textures
const ktx2Loader = new KTX2Loader()
  .setTranscoderPath('path/to/basis/')
  .detectSupport(renderer);

// Power-of-two texture dimensions
// 512x512, 1024x1024, 2048x2048

Mobile Optimization

const isMobile = /Android|iPhone|iPad|iPod/i.test(navigator.userAgent);

// Limit pixel ratio
renderer.setPixelRatio(Math.min(window.devicePixelRatio, isMobile ? 1.5 : 2));

// Reduce shadow map size on mobile
if (isMobile) {
  light.shadow.mapSize.width = 512;
  light.shadow.mapSize.height = 512;
}

TSL (Three.js Shading Language)

import { texture, uv, color, time, sin } from 'three/tsl';

const material = new THREE.MeshStandardNodeMaterial();
material.colorNode = texture(map).mul(color(0xff0000));
material.colorNode = color(0x00ff00).mul(sin(time).mul(0.5).add(0.5));

Key Patterns

PatternBenefit
Use InstancedMesh100x draw calls → 1 draw call
Merge static geometriesReduce draw calls
Use LOD (Level of Detail)Performance at distance
Enable frustum cullingSkip off-screen objects
Use texture atlasesReduce material switches
Bake lightingEliminate runtime shadows

Anti-Patterns

Anti-PatternFix
Creating objects in render loopCache and reuse
Not disposing resourcesAlways call.dispose()
Using BufferGeometry constructorUse specific geometry classes
Too many lightsLimit to 3-4 dynamic lights
High pixel ratio on mobileCap at 1.5-2

Attribution

Based on emalorenzo/three-agent-skills three-best-practices - 53+ installs. Official guidelines from Three.js llms branch maintained by mrdoob.

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

04

需要参考平台分布和安装热度时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

补充不同宿主或平台的使用分布数据

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Claude Code

31%
按下载量换算32

windsurf

21.73%
按下载量换算22

trae

16.89%
按下载量换算17

OpenCode

13.44%
按下载量换算14

Codex

8.4%
按下载量换算9

Antigravity

3.39%
按下载量换算3

安全审计

暂无安全审计结果可展示。

权限和风险

需要联网

该 Skill 可能需要联网访问来源站点、仓库或外部 API;具体网络访问范围需要结合源码和 README 复核。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills