Ztx11 three modern webgpu

From Realjustawall/Perfect-AI · View interactive version

Ztx11 three modern webgpu is an AI agent skill from the GitHub repository Realjustawall/Perfect-AI. Perfect_AI local offline-first Codex integration: Three.js Modern — WebGPU, TSL and Fallback. Use for Three.js WebGPU, TSL, shader material, version migration and feature support.

How to use this skill

Skill file

Three.js Modern — WebGPU, TSL and Fallback

Source: https://github.com/Picaresco/threejs-skill

Upstream license / handling: MIT

Distribution: This is a newly authored Perfect_AI adaptation; no upstream SKILL.md text, binaries, fonts or models are redistributed.

Activation, authority and safeguards

Step-by-step implementation

  1. Detect installed Three.js version and rendering backend before choosing WebGPU APIs.
  2. Define a WebGL2 fallback and static accessible representation; do not require experimental backend on every device.
  3. Use correct color space, tone mapping, pixel ratio, material and lights for renderer.
  4. Keep camera and subject placement dependent on container bounds and text exclusion zones.
  5. Measure render timing separately from loading/compilation.
  6. Dispose resources and stop animation when page hidden, unmounted or context lost.

Concrete scenarios and integration cues

Reference implementation / command

// Prefer backend detection over unconditional WebGPU initialization.
const supportsWebGPU = typeof navigator !== "undefined" && "gpu" in navigator;
const preferredBackend = supportsWebGPU ? "webgpu-candidate" : "webgl2";

Acceptance checks (verify, do not assume)

Common failure modes and corrective strategy

Contracts and outputs

Related Perfect_AI skills and stack

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.