Skill library

Agent skill Web motion

3D Retina Resolution

Use spatial graphics, scenes or materials to support a web experience.

  • 3D / WebGL

Install the skill

Installation method

Run the command from your project root with Node.js and npm.

npx skills@latest add https://github.com/MengTo/Skills/tree/main/agent-skills/3d/3d-retina-resolution --skill 3d-retina-resolution --agent claude-code --yes

Check this file in your project.claude/skills/3d-retina-resolution/SKILL.md

Other ways to install
  • Choose an assistant interactively

    npx skills@latest add https://github.com/MengTo/Skills/tree/main/agent-skills/3d/3d-retina-resolution --skill 3d-retina-resolution

    Select your assistant and choose the project installation scope.

    Official instructions

The tested Skills CLI 1.10.0 requires Node.js 22.20 or later. An existing WebGL renderer and camera, the canvas container, and access to any composer and custom render targets.

View operation manual

What this skill helps with

  • Use spatial graphics, scenes or materials to support a web experience.

Good for

  • 3D on the web
Publisher
Meng To
Control points
setPixelRatio(2) · setSize(width, height) · getDrawingBufferSize()
Verification target
The drawing buffer and full-resolution composer targets are 2× per axis and pointer alignment survives a resize.
Skill name
3d-retina-resolution
Repository
MengTo/Skills

Common pitfall

Avoid this prompt

Double input dimensions and also call setPixelRatio(2).

Logical sizing plus a ratio already scales the buffers. Double scaling allocates four times the CSS dimensions on each axis.

Use these steps

  1. Inspect inputs and rendering context
  2. Apply the documented technique
  3. Verify on the actual project route

Project walkthrough

Set an explicit 2× drawing buffer and keep renderer, composer, camera, and picking aligned.

Set an explicit 2× drawing buffer and keep renderer, composer, camera, and picking aligned.

  1. Inspect inputs and rendering context

    Inspect inputs and rendering context

    Prompt · Step 1
    Use 3D Retina Resolution on [viewer]. Record CSS size, drawing-buffer size, native DPR, and custom targets. Choose fixed 200% explicitly and document any separate Auto mode.
  2. Apply the documented technique

    Apply the documented technique

    Prompt · Step 2
    Set renderer and composer pixel ratio to 2 and pass logical dimensions to both size APIs. Update the camera aspect and projection. Resize only custom targets from physical dimensions and normalize raycasting from getBoundingClientRect() CSS coordinates.
  3. Verify on the actual project route

    The drawing buffer and full-resolution composer targets are 2× per axis and pointer alignment survives a resize.

    • The drawing buffer and full-resolution composer targets are 2× per axis and pointer alignment survives a resize.
    Prompt · Step 3
    At DPR 1 and 2, verify the fixed mode output remains approximately double each CSS axis. Resize narrow and wide and click the same visible point. Measure frame time and compare full-resolution composer buffers, optional downsampled passes, and picking accuracy.

Implementation lookup

Check these values in your existing project and its installed dependencies.

Find the documented controlsInputs
Command or reference
setPixelRatio(2) · setSize(width, height) · getDrawingBufferSize()
Examples
The drawing buffer and full-resolution composer targets are 2× per axis and pointer alignment survives a resize.

FAQ

What should I open after installing?

Open SKILL.md and REFERENCES.md in the installed skill directory. Apply the technique to your own scene or component and verify the specified result on that route.

How do I show the result is ready?

The drawing buffer and full-resolution composer targets are 2× per axis and pointer alignment survives a resize.