Inspiration
Everyone knows the moment just before sleep, when the room you're in starts to feel like somewhere else. And everyone knows the dream fall: the floor gives way and you jolt awake in your bed. Dreamscapes is built around both.
What it does
You sit in any chair and open a link. Your eyes grow heavy and close. When they open again, your own room is still there, but sunk in a deep blacklight blue, every wall and sofa still faintly visible. Then, one by one, four small circles of light open on your walls and ceiling and grow into windows:
- The Ledge: a sea wall in the fog, harbour lights on the horizon.
- Cloud Walk: a tower top 700 m above a city.
- The Gorge: rope bridges and prayer flags across a Himalayan valley.
- The Rim: a walk around an erupting crater, above the clouds.
How we built it
Meta's Immersive Web SDK on WebXR in AR mode: Three.js plus an entity-component system, hand tracking, plane and mesh detection (Space Setup), and passthrough. It runs straight from a URL in the Quest Browser and installs as a PWA.
Portals are stencil-masked tunnels, so each opening shows a hallway that recedes behind your real wall. A ceiling portal turns upright in front of you before the glide, so the glide itself is always one straight horizontal line.
The dreams are 100% procedural. No downloaded models, textures or audio: the terrain, mountains, sea, towers, volcano, bridges, boats and flags are all generated in code on a shared world kit (triplanar rock shading, baked shadows, instanced detail that follows your route).
You stay seated and the view never rotates on its own. Each glide is a straight line with a linear ease-in, vignettes narrow the view at speed, and the fall is short and capped. A Comfortable mode shortens it further. The system menu cleanly pauses the story, motion and audio. Everything that matters happens inside a comfortable view cone, and there is a narrower mode for Meta VR Glasses, where you choose by gaze and pinch.
Challenges we ran into
Real rooms are messy. Curtains, lamps and sofas kept hiding portals. A dream fall that's comfortable. We kept it short (about 2.6 s), capped its speed, never rotate the view, and let the world rush past you with particles and debris instead of moving the camera fast. Mobile GPU budget. Our rock shader originally did 36 texture reads per pixel. Packing the bump slope into the detail texture and skipping projections that barely contribute brought that down to at most 9, with the same look. We also built all four dream worlds while your eyes are closed, so nothing hitches in view.
Accomplishments that we're proud of
The first five minutes teach everything without a wall of text: two short lines of instruction, one practice hold, and the dream opens. Your real room changes the experience: the portals open on your walls, and the end of every dream is waking up in your chair. Four complete, distinct worlds, built entirely from code and synthesised sound, in a link.
What's next for Dreamscapes
More dreams, and dreams that react to your room's layout and size. Shared dreams: two people falling asleep in their own rooms and meeting in the same dream. Lucid moments: small hand interactions inside dreams (catching a falling leaf, ringing the bell buoy) without breaking the lean-back feel. A Horizon Store PWA release, plus further on-device performance tuning for Quest 3S.
Built With
- glsl
- iwsdk
- typescript
- vite
- webxr