Agent skill Web motion
Three.js Performance
Use spatial graphics, scenes or materials to support a web experience.
Install the skill
Run the command from your project root with Node.js and npm.
npx skills@latest add cloudai-x/threejs-skills --skill threejs-performance --agent claude-code --yesCheck this file in your project.claude/skills/threejs-performance/SKILL.md
Other ways to install
Choose an assistant interactively
npx skills@latest add cloudai-x/threejs-skills --skill threejs-performanceSelect your assistant and choose the project installation scope.
Official instructions
The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. A WebGLRenderer scene, a repeatable camera and layout, and repeated meshes sharing one geometry and material. The walkthrough uses the existing app renderer.
View operation manualWhat this skill helps with
- Use spatial graphics, scenes or materials to support a web experience.
Good for
- 3D on the web
- Publisher
- cloudai-x
- Control points
- renderer.info.render · InstancedMesh · setMatrixAt() · computeBoundingSphere()
- Result
- A matched draw-call comparison with unchanged placements and documented frame behavior.
- Skill name
threejs-performance- Repository
cloudai-x/threejs-skills
Common pitfall
Avoid this prompt
Merge all visible objects and quote one frame time as the speedup.
Whole-scene merging can hurt culling, and a single frame varies with warmup, scheduling, and pipeline configuration.
Use these steps
- Inspect the original target
- Apply the documented technique
- Verify the result in the project
Project walkthrough
Compare the same repeated geometry before and after instancing using WebGLRenderer counters.
Compare the same repeated geometry before and after instancing using WebGLRenderer counters.
Inspect the original target
Inspect the original target
Prompt · Step 1Use Three.js Performance on [my repeated signpost group]. Record camera, viewport, shadows, material, and any extra render passes. After rendering the matched baseline frame, read renderer.info.render.calls and triangles plus the live geometry and texture counts. Keep the pipeline constant for the comparison.Apply the documented technique
Apply the documented technique
Prompt · Step 2Replace the repeated signposts with one or a few spatially bounded InstancedMesh groups sharing their geometry and material. Copy the original transforms through setMatrixAt, mark instanceMatrix.needsUpdate when changing them, and refresh bounding volumes after moving instances. Keep object identity mapping if the viewer supports selection.Verify the result in the project
Matching scenes report draw calls and triangle counts, with positions and selection verified after instancing.
- Matching scenes report draw calls and triangle counts, with positions and selection verified after instancing.
Prompt · Step 3Render the identical camera pose and compare calls, triangles and visible positions. Then test a wider angle and picking. Take repeat frame timings after warmup and report counts separately from timings. If multiple passes render each frame, accumulate them consistently in both versions before resetting info.
Implementation lookup
Find the input and the expected observation for the selected workflow.
Check the control pointsInputs
- Command or reference
renderer.info.render · InstancedMesh · setMatrixAt() · computeBoundingSphere()- Examples
- Matching scenes report draw calls and triangle counts, with positions and selection verified after instancing.
FAQ
Does instancing reduce triangle count automatically?
It batches repeats that share geometry and material. The same visible instances can submit the same number of triangles through fewer draw calls.
Where can I verify the version?
Open the publisher’s pinned Skill source and compare the API references with the application’s lockfile.