threejs-rts-environment

Generates Three.js terrain shaders, chunk streaming, and LOD systems for browser RTS environments.

Updated Jul 13, 2026
One-click install
npx skills add https://github.com/Ohmnia/site-build --skill threejs-rts-environment-ohmnia
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-rts-environment
Source: https://github.com/Ohmnia/site-build/tree/main/.opencode/skills/threejs-rts-environment
Command: npx skills add https://github.com/Ohmnia/site-build --skill threejs-rts-environment-ohmnia

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Browser-based RTS environments often suffer from excessive draw calls, VRAM bloat, and unoptimized shaders that cause frame drops and browser context loss. This Skill enforces strict performance budgets and proven shader patterns so generated Three.js terrain systems stay fast and stable. ## Core Features & Use Cases - Procedural GLSL Terrain Shading: Implements slope-based texture blending, height fog, and vertex wind animation directly in custom shaders instead of heavy unique textures or skeletal rigs. - Chunk-Based World Streaming: Provides a TerrainStreamer pattern that loads and unloads map regions around the camera to keep memory and CPU usage bounded. - Performance Budget Enforcement: Applies hard limits such as under 500 draw calls, under 50 unique materials, under 512 MB VRAM, and KTX2/Basis Universal textures only. - Use Case: When building a large RTS map in Three.js, use this Skill to generate a terrain material with slope-gated grass/rock blending, wind-animated foliage, and a chunk streaming manager that respects the draw call budget. ## Quick Start Use the threejs-rts-environment skill to generate a chunked Three.js terrain system with slope-blended GLSL shaders and vertex wind animation that stays under 500 draw calls.

Frequently Asked Questions about threejs-rts-environment

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I blend terrain textures by slope in a Three.js shader?

Compute slope from the surface normal as 1.0 minus normal.y, then use smoothstep to mix grass and rock textures in the fragment shader. This procedural slope blending replaces flat unique albedo maps and separates cliffs from walkable paths automatically.

How to animate grass and trees in Three.js without skeletal bones?

Use stateless vertex displacement in the vertex shader, such as a sine wave driven by position and time. Scale the displacement by UV height so roots stay anchored while foliage tips sway, avoiding skeletal mixers entirely.

What texture format should I use for Three.js terrain splatting?

Use KTX2 or Basis Universal compressed textures exclusively for runtime terrain splatting. Uncompressed PNG or JPG images cause VRAM bloat and can trigger browser context loss on large maps.

Does this approach support WebGPU and WGSL shaders?

Current production code targets WebGL2 with GLSL, but data structures use flat typed arrays like Float32Array so systems can migrate to WebGPU compute pipelines and WGSL shaders later without redesigning boundaries.

Why does my Three.js RTS map lag despite low polygon counts?

Draw calls, not polygon counts, usually kill browser game performance. Reduce unique materials below 50 with texture atlases, batch geometry aggressively, and keep total draw calls under 500 per frame.