用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
直接命令不会经过审查 Prompt;运行前请先检查来源。
npx skills add https://github.com/feliperyba/ralph-orchestra --skill dev-performance-instancing命令会保持在同一行。复制前请横向滚动并检查完整内容。
想先保存到本地?可下载 SkillsMP 当前能够提供的文件。
Complete Developer workflow orchestration - task research sequence, implementation flow, validation gates, PRD synchronization, exit conditions.
Complete Game Designer workflow - skill invocation protocol, GDD creation, playtest flow with GDD review, design sessions. MUST load before starting assignments.
Complete PM Coordinator workflow - task assignment, project orchestration, PRD management, worker coordination. Use proactively when starting PM agent work.
正在显示 SKILL.md
基于 SOC 职业分类
| name | dev-performance-instancing |
| description | Instanced rendering for repeated objects in R3F. Use when rendering many identical objects. |
| category | performance |
Render thousands of identical objects with a single draw call.
Use when:
import { Instances, Instance } from '@react-three/drei';
// Instead of 1000 separate meshes
function OptimizedTrees({ positions }) {
return (
<Instances limit={positions.length}>
<cylinderGeometry args={[0.1, 0.3, 2]} />
<meshStandardMaterial color="brown" />
{positions.map((pos, i) => (
<Instance key={i} position={pos} />
))}
</Instances>
);
}
| Approach | Objects | Draw Calls | FPS |
|---|---|---|---|
| Individual meshes | 1000 | 1000 | 15 |
| Instanced | 1000 | 1 | 60 |
import { Instances, Instance } from '@react-three/drei';
function DynamicParticles({ count = 100 }) {
const particles = useRef<Array<{ x: number; y: number; z: number }>>([]);
// Initialize particles
useMemo(() => {
for (let i = 0; i < count; i++) {
particles.current.push({
x: (Math.random() - 0.5) * 10,
y: (Math.random() - 0.5) * 10,
z: (Math.random() - 0.5) * 10,
});
}
}, [count]);
return (
<Instances limit={count}>
<sphereGeometry args={[0.1, 8, 8]} />
<meshBasicMaterial color= />
{particles.current.map((pos, i) => (
))}
);
}
function ColoredInstances() {
const colors = useMemo(() =>
Array.from({ length: 100 }, () => ({
color: new THREE.Color(Math.random(), Math.random(), Math.random()),
}))
, []);
return (
<Instances limit={100}>
<boxGeometry args={[1, 1, 1]} />
<meshStandardMaterial />
{colors.map((props, i) => (
<Instance
key={i}
position={[(i % 10) * 1.2, Math.floor(i / 10) * 1.2, 0]}
color={props.color}
/>
))}
</Instances>
);
}
| ❌ Can't | ✅ Alternative |
|---|---|
| Different geometries per instance | Use separate Instances groups |
| Different materials per instance | Use vertex colors or textures |
| Complex animations per instance | Use shader-based animation |
| ❌ Wrong | ✅ Right |
|---|---|
| Using individual meshes for repeated objects | Use Instances |
| Not setting limit prop | Always set limit higher than max count |
| Creating new Instance objects every frame | Use stable key, update position prop |