Back to skills
SKILL.md
Webgl Phaser Threejs Mastery
ASecurityEnforce professional standards for browser-based gaming and interactive 3D experiences. This skill covers **Phaser** (2D) and **Three.js** (3D) to maximize performance across desktop and mobile browsers.
- 2 stars
- 0 votes
- 0 copies
- 0 views
- Added November 24, 2026
Works with
Security analysis
100/100Pro scans all 4 files and shows the line behind each finding
npx -y skills add iDorgham/Workspace-Factory --skill webgl-phaser-threejs-mastery --agent claude-codeAre you the author of Webgl Phaser Threejs Mastery?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/idorgham-webgl-phaser-threejs-mastery)---
type: Skill
subagents: [core-validator, integrity-bot]
agents: [master-guide, swarm-router]
dependencies: [core-orchestration, global-sync]
version: 1.0.0
---
# π Web Gaming & Interactive Mastery (WebGL)
## Purpose
Enforce professional standards for browser-based gaming and interactive 3D experiences. This skill covers **Phaser** (2D) and **Three.js** (3D) to maximize performance across desktop and mobile browsers.
---
## Technique 1 β Three.js & WebGL Optimization
### Draw Call Reduction
- **Rule**: Minimize draw calls by using `BufferGeometry` and `InstancedMesh` for repeated assets (e.g., forest trees, asteroid fields).
- **Protocol**: Batch textures into **Texture Atlases** to reduce GPU state changes.
### Texture Compression
- **Rule**: Do not serve raw PNG/JPG for heavy 3D assets.
- **Correction**: Use **KTX2 / Basis Universal** compression for GPU-native texture decoding without CPU overhead.
---
## Technique 2 β Phaser (2D Games)
### Physics & Collision
- **Arcade Physics**: Use for simple 2D games with square/circle hitboxes.
- **Matter.js**: Use for complex 2D physics with non-uniform polygons.
### Sound Management
- **Rule**: Audio must be user-triggered (Browser Autoplay Policy).
- **Implementation**: Cache audio assets in `Preload()` to avoid clicking/lag during gameplay.
---
## π‘οΈ Critical Failure Modes (Anti-Patterns)
| Anti-Pattern | Result | Correction |
| :--- | :--- | :--- |
| **High Polygon Count** | Tab Crashes / Lag | Keep mobile target poly-count < 100k per scene. |
| **No "Loss of Context" Handling** | Black screen on resume | Implement `webglcontextlost` and `webglcontextrestored` listeners. |
| **Heavy Main Thread** | Input lag | Move non-rendering logic (Pathfinding, Worker-heavy math) to **Web Workers**. |
---
## Success Criteria (Web Gaming QA)
- [ ] Render loop achieves solid 60FPS on mid-range mobile browsers.
- [ ] Asset bundle size is optimized (Initial load < 5MB).
- [ ] Responsive design works for Portrait/Landscape orientations.
- [ ] GPU memory usage verified via `three-perf` or browser devtools.Files in this skill
- SKILL.md
- core.py
- manifest.yaml
- tests/test_core.py
Attribution
Related skills
View all in development βComments
Loading commentsβ¦
Newsletter
Get the weekly list of safe new skills, and the ones we pulled.