3d-retina-resolution
Installation
SKILL.md
3D Retina Resolution
Treat an explicit 200% rendering request as two drawing-buffer pixels per CSS pixel in each dimension. A 1200 × 800 CSS canvas therefore uses a 2400 × 1600 drawing buffer, or four times the pixels of 100%. Layout and camera framing stay unchanged.
Choose the scale deliberately
- Fixed 200%: effective pixel ratio is
2, independent of device pixel ratio. This is the default when the user explicitly requests 200%. - Automatic Retina, capped at 2×: effective ratio is
Math.min(window.devicePixelRatio || 1, 2). This can render at 1× on an ordinary display; label it Auto rather than claiming it always renders at 200%. - Relative to native resolution: multiply native DPR only when the user explicitly wants that meaning. Native 2× multiplied by another 2 becomes 4× per dimension, or sixteen times the CSS pixel count.
Keep an explicit quality selection distinct from automatic adaptation. Inspect the project's renderer and post-processing architecture before changing sizing.
Synchronize the rendering pipeline
Use CSS to size the canvas and its container, then measure the container in CSS pixels. In Three.js WebGL, one consistent convention is logical sizes plus pixel ratio: