3d-retina-resolution

Configures Three.js renderers and composers for sharp 200% Retina rendering.

6.3k|743|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill 3d-retina-resolution-mengto
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: 3d-retina-resolution
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/3d/3d-retina-resolution
Command: npx skills add https://github.com/MengTo/Skills --skill 3d-retina-resolution-mengto

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? WebGL canvases often look blurry on Retina and HiDPI displays because the drawing buffer, renderer pixel ratio, and post-processing composer sizes fall out of sync. This Skill provides a disciplined workflow for rendering a 3D canvas at an explicit 200% resolution without breaking layout, camera framing, or pointer coordinates. ## Core Features & Use Cases - Deliberate scale selection: Distinguishes fixed 200% rendering, automatic Retina capped at 2x, and native-DPR-relative scaling so the reported quality matches the actual output. - Synchronized pipeline sizing: Keeps renderer.setPixelRatio, renderer.setSize, composer.setPixelRatio, composer.setSize, camera aspect, and custom render targets consistent in logical and physical pixels. - Resize and pointer handling: Uses ResizeObserver, DPR re-evaluation on zoom or display changes, and getBoundingClientRect-based pointer normalization for correct raycasting. - Budget and fallback policy: Measures frame time at 1x and 2x, checks GPU limits, and steps down optional post-effects before compromising the main view. - Use Case: A user reports that their Three.js landing page hero looks soft on a MacBook display. Use this Skill to set a fixed 200% drawing buffer, synchronize the EffectComposer, and verify canvas.width matches twice the CSS size. ## Quick Start Use the 3d-retina-resolution skill to render this Three.js scene at fixed 200% resolution and verify every render buffer matches the expected drawing buffer size.

Frequently Asked Questions about 3d-retina-resolution

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix a blurry Three.js canvas on Retina displays?▼

Set renderer.setPixelRatio(2) and renderer.setSize(width, height, false) so CSS controls displayed dimensions while the drawing buffer doubles. Also call composer.setPixelRatio and composer.setSize with logical pixels so post-processing buffers match the Retina output.

How to render WebGL at 200 percent resolution in Three.js?▼

Treat 200% as two drawing-buffer pixels per CSS pixel per dimension, so a 1200x800 canvas uses a 2400x1600 buffer. Apply the ratio through setPixelRatio on both the renderer and composer, passing logical sizes to setSize to avoid quadruple allocation.

Why is my EffectComposer output still blurry after increasing resolution?▼

The renderer and composer each maintain their own pixel ratio, so updating only the canvas leaves a low-resolution intermediate image stretched to the output. Passing already-doubled dimensions into a composer with DPR 2 also allocates 4x buffers, wasting memory.

Does higher rendering resolution fix blurry textures or models?▼

No, Retina output does not improve a blurry texture, coarse model, low shadow map, or low-resolution reflection. Those sources must be checked independently, since resolution and asset quality solve different artifacts.

How do I keep pointer raycasting correct at 2x pixel ratio?▼

Normalize pointer coordinates from CSS space using canvas.getBoundingClientRect(): (clientX - rect.left) / rect.width, and likewise for Y. Raycasting uses these normalized coordinates, not drawing-buffer pixels; convert to physical pixels only for APIs like pixel readback.

When should I use automatic DPR instead of fixed 200% rendering?▼

Use Auto mode, Math.min(window.devicePixelRatio || 1, 2), when the experience should adapt to ordinary displays and step down after sustained poor frame time. Fixed 200% should stay fixed unless a concrete hardware or allocation failure requires a visible fallback.