Parallax scrolling creates depth illusion by moving background layers at different speeds — distant layers scroll slowly while near layers move fast. This shader builds four procedural layers: a twinkling star field, distant mountains, mid-ground hills with tree silhouettes, and a foreground with grass. Each layer offset is uv.x + iTime * speed, where speed increases for nearer layers.
Key Concepts
parallax depth layers
procedural terrain
star field generation
scroll speed variation
Try this shader live in the Shader Sandbox editor with real-time preview.