mcpField
T
threejs-renderers

threejs-renderers

github.com/full-stack-skillsDevelopment10392 installsUpdated 4w ago
Repository

About threejs-renderers

threejs-renderers is a skill for agents working with three.js renderer setup, sizing, color management, render targets, and profiling. It offers guidance tied to the official documentation and clarifies which neighboring skills cover post-processing, loading, and WebXR details.

Key features

  1. 01WebGLRenderer and WebGPURenderer setup
  2. 02Canvas sizing and pixel-ratio guidance
  3. 03Color-space and tone-mapping guidance
  4. 04Render-target selection and cleanup
  5. 05Renderer profiling with renderer.info

Use cases

  1. 01Configure a renderer for a three.js scene
  2. 02Diagnose color-space or tone-mapping issues
  3. 03Set up offscreen rendering and render targets
  4. 04Inspect renderer statistics during development

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/full-stack-skills/threejs-skills --skill threejs-renderers

After installing, type/threejs-renderersin Claude Code to confirm it loaded.

Bundled files

References and scripts installed along with SKILL.md.

agents/
openai.yaml
examples/
workflow-renderer-resize.md
references/
official-sections.md

Details

From the project README

When to use this skill

ALWAYS use this skill when the user mentions:

  • WebGLRenderer or WebGPURenderer creation, setSize, setPixelRatio, setAnimationLoop
  • Color management: outputColorSpace, toneMapping, exposure-like behavior via renderer properties
  • WebGLRenderTarget, WebGLCubeRenderTarget, MRT, readback, or render-to-texture setup at renderer level
  • Info (render, triangles, calls) for profiling; CanvasTarget / storage textures when working from docs index

IMPORTANT: this skill vs neighbors

TopicUse skill
Fullscreen passes, bloom, SSAO, composer chainthreejs-postprocessing
VR/AR session, XRButton, hand modelsthreejs-webxr
Node-based frame graph / TSL post stackthreejs-node-tsl + renderer enablement
Loading assetsthreejs-loaders

Trigger phrases include:

  • "WebGLRenderer", "WebGPURenderer", "setPixelRatio", "toneMapping", "WebGLRenderTarget"
  • "渲染器", "像素比", "色调映射", "离屏渲染"

How to use this skill

  1. Choose API: WebGLRenderer for widest compatibility; WebGPURenderer when targeting WebGPU and node/TSL stack per project rules.
  2. Size: match drawing buffer to canvas CSS size × devicePixelRatio with a sane cap (performance).
  3. Color: set outputColorSpace / toneMapping consistently with textures and materials (cross-link threejs-textures, threejs-materials).
  4. Loop: prefer setAnimationLoop for WebXR-friendly loops; otherwise requestAnimationFrame.
  5. Render targets: pick WebGLRenderTarget vs cube/3D/array variants per environment/reflection needs; document dispose when recreating.
  6. Overlay UI: import CSS2DRenderer / CSS3DRenderer from addons; sync size with main renderer.
  7. Profiling: read renderer.info in dev builds only; explain cost of high pixel ratio and overdraw.
  8. WebXR hook: enable XR on renderer but delegate session to threejs-webxr.

See examples/workflow-renderer-resize.md.

Doc map (official)

Docs sectionRepresentative links
Core Renderershttps://threejs.org/docs/WebGLRenderer.html
WebGPUhttps://threejs.org/docs/WebGPURenderer.html
Render targetshttps://threejs.org/docs/WebGLRenderTarget.html
Core PostProcessing (class)https://threejs.org/docs/PostProcessing.html
Addons renderershttps://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 outputColorSpace causes washed or crushed blacks.
  • Forgetting dispose() on render targets and full-screen quads leaks GPU memory on hot reload.
  • WebGPURenderer feature 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:

  1. Link official renderer or render-target pages (WebGLRenderer, WebGLRenderTarget, etc.).
  2. Relate outputColorSpace / toneMapping to threejs-textures and threejs-materials when color looks wrong.
  3. Point XR session details to threejs-webxr after renderer.xr.enabled is mentioned.
  4. Mention dispose() for render targets and render lists on teardown or hot reload.
  5. Cite Addons → Renderers (CSS2DRenderer, …) when overlays are in scope.

References

Keywords

English: webglrenderer, webgpurenderer, rendertarget, pixelratio, tonemapping, outputcolorspace, css2d, css3d, three.js

中文: WebGLRenderer、WebGPU、渲染目标、像素比、色调映射、输出色彩空间、渲染器、three.js

Comments

Markdown supported