threejs-renderers
Skill9 starsChanged 54 days agoApache-2.0View on GitHub
Core rendering pipeline for three.js using WebGLRenderer and WebGPURenderer, canvas sizing, device pixel ratio, color space and tone mapping, output encoding, WebGL/WebGPU render targets, Info statistics, and addon overlay renderers (CSS2D/CSS3D/SVG). Use when tuning the draw loop, performance, or switching WebGPU vs WebGL; for EffectComposer passes use threejs-postprocessing; for XR session lifecycle use threejs-webxr; for shader graphs use threejs-node-tsl.
In this repository21 other files it gives its agents.
- openspec-apply-changeSkill
- openspec-archive-changeSkill
- openspec-exploreSkill
- openspec-proposeSkill
- threejs-animationSkill
- threejs-audioSkill
- threejs-cameraSkill
- threejs-controlsSkill
- threejs-dev-setupSkill
- threejs-geometriesSkill
- threejs-helpersSkill
- threejs-lightsSkill
- threejs-loadersSkill
- threejs-materialsSkill
- threejs-mathSkill
- threejs-node-tslSkill
- threejs-objectsSkill
- threejs-postprocessingSkill
- threejs-scenesSkill
- threejs-texturesSkill
- threejs-webxrSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 1 is distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈1
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 34
Loop: prefer setAnimationLoop for WebXR-friendly loops.
- Very specific: line 36
Overlay UI: import CSS2DRenderer / CSS3DRenderer from addons.
- Very specific: line 37
Profiling: read renderer.info in dev builds only.
- Distinctive: line 72
When answering under this skill, prefer responses that:
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
When to use this skill
ALWAYS use this skill when the user mentions:
WebGLRendererorWebGPURenderercreation,setSize,setPixelRatio,setAnimationLoop- Color management:
outputColorSpace,toneMapping, exposure-like behavior via renderer properties WebGLRenderTarget,WebGLCubeRenderTarget, MRT, readback, or render-to-texture setup at renderer levelInfo(render,triangles,calls) for profiling;CanvasTarget/ storage textures when working from docs index
IMPORTANT: this skill vs neighbors
| Topic | Use skill |
| Fullscreen passes, bloom, SSAO, composer chain | threejs-postprocessing |
VR/AR session, XRButton, hand models | threejs-webxr |
| Node-based frame graph / TSL post stack | threejs-node-tsl + renderer enablement |
| Loading assets | threejs-loaders |
Trigger phrases include:
- "WebGLRenderer", "WebGPURenderer", "setPixelRatio", "toneMapping", "WebGLRenderTarget"
- "渲染器", "像素比", "色调映射", "离屏渲染"
How to use this skill
- Choose API:
WebGLRendererfor widest compatibility;WebGPURendererwhen targeting WebGPU and node/TSL stack per project rules. - Size: match drawing buffer to canvas CSS size ×
devicePixelRatiowith a sane cap (performance). - Color: set
outputColorSpace/toneMappingconsistently with textures and materials (cross-link threejs-textures, threejs-materials). - Loop: prefer
setAnimationLoopfor WebXR-friendly loops; otherwiserequestAnimationFrame. - Render targets: pick
WebGLRenderTargetvs cube/3D/array variants per environment/reflection needs; document dispose when recreating. - Overlay UI: import
CSS2DRenderer/CSS3DRendererfrom addons; sync size with main renderer. - Profiling: read
renderer.infoin dev builds only; explain cost of high pixel ratio and overdraw. - WebXR hook: enable XR on renderer but delegate session to threejs-webxr.
See examples/workflow-renderer-resize.md.
Doc map (official)
| Docs section | Representative links |
| Core Renderers | https://threejs.org/docs/WebGLRenderer.html |
| WebGPU | https://threejs.org/docs/WebGPURenderer.html |
| Render targets | https://threejs.org/docs/WebGLRenderTarget.html |
| Core PostProcessing (class) | https://threejs.org/docs/PostProcessing.html |
| Addons renderers | https://threejs.org/docs/CSS2DRenderer.html |
More class links: references/official-sections.md.
Scope
- In scope: Renderer construction, sizing, color/tone, targets, Info, addon CSS/SVG renderers, high-level XR enable only.
- Out of scope: Individual composer passes (threejs-postprocessing); XR input (threejs-webxr); file IO (threejs-loaders).
Common pitfalls and best practices
- Uncapped DPR burns fill rate; cap
setPixelRatio(Math.min(devicePixelRatio, 2))on dense scenes. - Mixing sRGB textures with wrong
outputColorSpacecauses washed or crushed blacks. - Forgetting
dispose()on render targets and full-screen quads leaks GPU memory on hot reload. WebGPURendererfeature set moves quickly—always cite current docs version note in answers.
Documentation and version
WebGLRenderer, WebGPURenderer, and color-management defaults evolve across releases. Use the Renderers section of three.js docs for the user’s three.js line; WebGPU and node stacks may require newer minors—link class pages rather than memorizing constructor defaults.
Agent response checklist
When answering under this skill, prefer responses that:
- Link official renderer or render-target pages (
WebGLRenderer,WebGLRenderTarget, etc.). - Relate
outputColorSpace/toneMappingto threejs-textures and threejs-materials when color looks wrong. - Point XR session details to threejs-webxr after
renderer.xr.enabledis mentioned. - Mention
dispose()for render targets and render lists on teardown or hot reload. - Cite Addons → Renderers (
CSS2DRenderer, …) when overlays are in scope.
References
- https://threejs.org/docs/WebGLRenderer.html
- https://threejs.org/docs/WebGPURenderer.html
- https://threejs.org/docs/#Renderers
- https://threejs.org/docs/Info.html
Keywords
English: webglrenderer, webgpurenderer, rendertarget, pixelratio, tonemapping, outputcolorspace, css2d, css3d, three.js
中文: WebGLRenderer、WebGPU、渲染目标、像素比、色调映射、输出色彩空间、渲染器、three.js
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

