Three webgl game

From fanfan-de/anybox · View interactive version

Three webgl game is an AI agent skill from the GitHub repository fanfan-de/anybox. Implement browser-game runtimes with plain Three.js. Use when the user wants imperative scene control in TypeScript or Vite with GLB assets, loaders, physics, and low-level WebGL debugging.

How to use this skill

Skill file

Three WebGL Game

Overview

Use this skill for the default non-React 3D path in the plugin. This is not generic WebGL advice. It is an opinionated stack for browser 3D work:

Use this skill when the project wants direct scene, camera, renderer, and game-loop control. If the app already lives in React, route to ../react-three-fiber-game/SKILL.md instead.

Use This Skill When

Do Not Use This Skill When

Core Rules

  1. Keep simulation state outside Three.js objects.
  1. Treat the render graph as an adapter.
  1. Keep camera behavior explicit.
  1. Keep UI out of WebGL unless the presentation absolutely depends on it.
  1. Use GLB or glTF 2.0 as the default shipping model format.
  1. Use Rapier instead of ad hoc collision code when the game has meaningful 3D physics or collision response.
  2. Keep the first playable view low-chrome.

Initial Scaffold UX

For exploration, traversal, and character-control prototypes, start with a sparse shell:

Only add larger UI surfaces when the game loop truly requires them. Journal, quest log, codex, map, and settings surfaces should open on demand, not occupy the viewport by default.

Recommended Structure

Use the module shape in ../../references/three-webgl-architecture.md, then keep these boundaries clean:

Good Fit Scenarios

Loaders, Assets, and Post-Processing

Shader and Material Guidance

Browser Safety

Scope Warning

Do not claim that this plugin offers equal 3D depth to the Phaser track. It supports serious 3D implementation, but the plugin is still 2D-first overall.

References

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.