3d-retina-resolution
Qué hace
Esta skill guía al agente para corregir lienzos 3D borrosos en páginas web, incluidas las pantallas de alta densidad. Está pensada para desarrolladores cuyas escenas 3D se ven suaves o pixeladas en pantallas modernas.
Cuándo usarla
- ✓Cuando una escena 3D WebGL se ve borrosa en una pantalla Retina o de alta densidad.
- ✓Cuando quieres que la salida 3D se renderice al 200 por ciento.
- ✓Cuando los clics en un lienzo 3D caen en un lugar incorrecto tras cambiar el tamaño.
Link de la skill
https://github.com/MengTo/Skills/blob/main/agent-skills/3d/3d-retina-resolution/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Mi visor de producto 3D se ve borroso en mi portátil. Haz que se vea nítido al 200 por ciento sin cambiar el diseño.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente configura el tamaño de dibujo del lienzo y la proporción de píxeles por separado del diseño de la página, mantiene sincronizadas todas las partes del proceso de renderizado y mide el rendimiento con una opción alternativa.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de GitHub.
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:
function resize3D(width, height, ratio = 2) {
if (!Number.isFinite(width) || !Number.isFinite(height) || width <= 0 || height <= 0) return;
if (!Number.isFinite(ratio) || ratio <= 0) throw new RangeError('Invalid render ratio');
renderer.setPixelRatio(ratio);
renderer.setSize(width, height, false); // CSS owns displayed dimensions
camera.aspect = width / height; // perspective camera
camera.updateProjectionMatrix();
if (composer) {
composer.setPixelRatio(ratio);
composer.setSize(width, height); // logical pixels; do not multiply again
}
const physicalWidth = renderer.domElement.width;
const physicalHeight = renderer.domElement.height;
resizeCustomTargets(physicalWidth, physicalHeight);
}
The snippet assumes an existing renderer, perspective camera, optional composer (or null), and a resizeCustomTargets adapter supplied by the app. For an orthographic camera, update its bounds according to the existing framing policy instead of setting aspect.
The adapter updates only app-owned targets and uniforms; composer-managed passes already receive sizing through the composer. Set full-resolution depth/normal targets to physical dimensions. Size lower-resolution AO, bloom, or ray targets by their deliberate scale factors. Set sampling-resolution uniforms to the dimensions of the texture actually sampled, including reciprocal resolution where the shader expects it.
The renderer and composer each maintain their own pixel ratio. Updating only the canvas can leave a lower-resolution intermediate image stretched to a Retina output. Conversely, passing already doubled dimensions into a composer that also has DPR 2 allocates 4× dimensions. See the renderer and composer sizing APIs.
Handle layout and display changes
Observe the canvas container with ResizeObserver, coalesce notifications, and resize only when dimensions or effective ratio change. Skip zero-sized hidden views and retry when they become visible. Re-evaluate native DPR on browser zoom or display changes in Auto mode, including when CSS dimensions remain unchanged. Recreate a resolution media-query listener after each DPR change if using that approach.
Use canvas.getBoundingClientRect() for pointer normalization: (clientX - rect.left) / rect.width, and likewise for Y. Raycasting uses normalized coordinates derived from CSS space, not drawing-buffer pixels. Convert to physical pixels separately only for APIs such as a pixel readback.
Retina output does not automatically improve a blurry texture, coarse model, shadow map, or low-resolution reflection. Check those sources independently. Avoid CSS scaling or image-rendering: pixelated as a substitute for the correct drawing buffer. Higher resolution and antialiasing solve related but different artifacts.
Budget and fallback
Measure the scene at 1× and 2× with the same camera. Track frame time, target dimensions, allocation failures, and total passes. Check GPU limits before allocating exceptionally large targets, including maximum texture/renderbuffer dimensions and viewport limits.
Reduce optional post-effect resolution o
Preguntas frecuentes
¿Renderizar al 200 por ciento cambia el diseño de la página?
No. El diseño y el encuadre de la cámara se mantienen igual, y solo cambia el detalle del dibujo.
¿El modo automático siempre usa el 200 por ciento?
No. El modo automático limita la proporción a 2 veces y puede renderizar a 1 vez en una pantalla normal.
¿Una resolución mayor ralentizará la escena?
Usa más potencia gráfica, así que la skill sugiere alternativas medidas para los dispositivos más lentos.
Detalles
Descripción original del autor
Render a 3D canvas sharply on Retina and HiDPI displays, including explicit 200 percent resolution, synchronized renderer and post-processing sizes, correct pointer coordinates, and measured quality fallbacks. Use for blurry WebGL output, 2x rendering, high-resolution previews, and display-density changes.
repo: MengTo/Skills
Popularidad
- Estrellas en GitHub
- 7,2 mil
- Posición en el ranking
- #13321
- Licencia
- MIT
- Actualizada
- 1/11/2026
Comentarios
- …
Más skills de este repositorio
3d-cloth-material
7,2 milAyuda a tu agente a crear tela tejida realista en Three.js, con el entramado del hilo, un brillo suave, pliegues naturales, dobladillos y costuras.
3d-falling-leaves
7,2 milAyuda a tu agente a añadir hojas que caen de forma realista a una escena 3D, con hojas que giran, se dejan llevar por el viento y se reciclan al moverse la cámara.
3d-four-seasons
7,2 milAyuda a tu agente a añadir los aspectos de primavera, verano, otoño e invierno a una escena 3D, cambiando la vegetación, la luz, el cielo y la nieve sin reconstruirla.
3d-high-poly-models
7,2 milAyuda a tu agente a construir modelos 3D detallados con formas suaves y bordes creíbles, y después preparar versiones más ligeras que funcionen bien en la web.
Skills parecidas
angular-developer
280 milAyuda a tu agente con código de Angular y la estructura del proyecto. Útil para empezar proyectos, crear partes de código o mejorar el rendimiento y la accesibilidad.
frontend-a11y
280 milAyuda a tu agente a hacer que las interfaces web sean accesibles para todos. Asegura que sitios y apps funcionen bien con lectores de pantalla y navegación por teclado.
frontend-patterns
280 milHace que tu agente aplique patrones modernos en desarrollo frontend. Optimiza el rendimiento, gestiona el estado y sigue buenas prácticas en React y Next.js.