threejs-landscape

Builds procedural Three.js landscapes with polar-grid terrain, instanced grass, and cross-fading time-of-day states.

5.7k|685|Updated Feb 3, 2026
One-click install
npx skills add https://github.com/MengTo/Skills --skill threejs-landscape
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: threejs-landscape
Source: https://github.com/MengTo/Skills/tree/main/agent-skills/web-design/threejs-landscape
Command: npx skills add https://github.com/MengTo/Skills --skill threejs-landscape

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires three, and includes assets (resource) components.

What problem does it solve?

Hero backdrops and product stages often look like subjects floating on a flat gradient because building convincing real-time terrain, vegetation, sky, and lighting in Three.js involves many subtle pitfalls: wasted triangles, texture seams, invisible stars, and jarring lighting cuts. This Skill provides a proven recipe for a live procedural landscape that grounds a subject in a believable place.

Core Features & Use Cases

  • Polar-grid heightfield terrain: Sample a domain-warped noise heightfield on a polar grid centred under the camera so resolution follows the lens, with vertex colours computed from slope and moisture instead of textures.
  • GPU-instanced grass and stones: Render 100k+ grass blades as a single InstancedMesh shaped entirely in the vertex shader, plus scattered stones from the same height function, keeping wind animation off the CPU.
  • Gradient sky, stars, and time-of-day system: Paint a six-stop sky gradient on a tiny canvas, confine a star field to the visible elevation band, and cross-fade full lighting states between morning, noon, sunset, and night.
  • Use Case: Build a landing page hero where a product or building sits in a grassy plain, letting users orbit the scene and switch times of day with smooth transitions.

Quick Start

Use the threejs-landscape skill to build a standalone HTML page with procedural terrain, instanced grass, a gradient sky, and cross-fading times of day behind my subject.

Frequently Asked Questions about threejs-landscape

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

FAQPage Schema
How do I build a procedural terrain in Three.js?

Sample a noise heightfield on a polar grid centred under the camera, with radial rings spaced by a power curve so resolution follows the lens. Domain-warp the sample position with another noise field before layering fBm and ridged octaves to avoid a crumpled-paper look.

How to render thousands of grass blades in Three.js without lag?

Use a single InstancedMesh of a five-segment ribbon and do all bending, leaning, and wind gusts in the vertex shader via onBeforeCompile, so the CPU cost is zero. Anchor a fixed patch of blades to the camera and snap it to a grid instead of growing the field.

Why are my Three.js points stars invisible on retina displays?

PointsMaterial size is in device pixels, so stars shrink or vanish on high-DPR screens. Scale the size by devicePixelRatio, use additive blending with sizeAttenuation false, and confine stars to the elevation band the camera can actually reach.

How do I smoothly transition lighting between times of day in Three.js?

Store each time of day as a full state covering sun, hemisphere, ambient, fog, sky stops, and star opacity, then lerp between two states. When switching mid-transition, freeze the current interpolated state as the new starting point so it never jumps.

Why can I see the sky through my Three.js terrain mesh?

This happens when triangle winding is inverted on a polar grid, making faces point downward. Index quads as (a0, b1, b0, a0, a1, b1) and verify by deliberately orbiting below the horizon before building anything on top.