Three.jsGSAP ScrollTriggerGLSLCanvas texturesTypeScript
Controls
- Scroll to move through the chapters: plan, build, the three materials, model vs finished, and light
- In the split chapter drag the divider (or focus it and use the left and right arrow keys) to compare the clay model with the finished house
- In the last chapter pick Day, Dusk or Night, switch snowfall on or off, and drag sideways (or use the arrow keys) to turn around the front
- Add ?quality=low to force the light tier or ?debug to show the frame rate
Needs WebGL. Without it, or if the graphics context is lost, the poster is shown. Phones start on a lighter tier (no shadow maps, smaller textures, fewer snowflakes and trees). Respects the reduced-motion setting: chapters change in one cut, snow stands still and there is no camera drift.
Questions
Is Hollin House a real building or studio?
No. It is a concept made for this Lab to show how a residential design studio could present a project on the web. The house, its name and the copy are fictional.
Is the house a 3D model file?
No. Every wall, roof, window, door, boulder and tree is built in code from boxes, extruded outlines and cones, and the cedar, stone, render, shingle and snow textures are drawn on canvases at load time. No model files or images are downloaded for the scene.
How does the scroll drive the scene?
GSAP ScrollTrigger maps the page scroll to one progress value. Each chapter is a keyframe with a camera pose and scene values such as how much of the house stands, how strong the plan lines are and the light; the render loop blends between neighbouring keyframes with a rest at each chapter.
How is the clay versus finished comparison made?
The scene is drawn twice per frame with the scissor test: the right part normally, the left part with one plain clay material over every object and a studio-grey background. Moving the divider only changes where the scissor cut falls.
Does it work on phones?
Yes. Phones and low-core devices start on a lighter tier without shadow maps, with smaller textures and fewer trees and snowflakes, the camera pulls back on tall screens so the whole house stays in frame, and the copy sits on a paper panel at the bottom.
How it’s built
Hollin House is a concept: a fictional winter home presented the way a residential design studio could show a project on its site. Everything in the scene is made in code with Three.js; no model files, HDRIs or texture images are downloaded.
The house
- Walls are extruded outlines (a polygon pushed along depth) with UVs in metres, so every texture tiles at its real size. Roofs are sloped boards placed between two points, and the snow on them is a second, thinner board on top.
- The cedar boards, ledgestone courses, render grain, shingles, snow and the lit interiors behind the glass are drawn on canvases at load time from a seeded random generator, so they look the same on every visit.
- Windows are black frame bars around a glass pane whose warm emissive map fakes a lit room at dusk and night.
- The yard has instanced string lights on small spruces, snow banks, boulders with snow caps, path bollards, a mailbox, a firewood rack against the cedar, gutters and downspouts, a concrete plinth under the cladding, additive light pools on the snow and warm sprite halos around the wall lamps, and instanced string lights that sag between hooks along the garage eave and the wing roof. At night the sky shader adds stars from a hash on a direction grid. Smoke from the flue is one small
Points draw that rises, widens and drifts in the vertex shader. The forest is three instanced bare-tree shapes (recursive branches merged into one geometry each) and an instanced spruce with snow on its upward faces through vertex colours.
The scroll story
- GSAP ScrollTrigger maps the page scroll to one progress value. Each chapter is a keyframe (camera pose, how much of the house stands, plan lines, split, light, snow, pinned material); the render loop rests on each keyframe for part of the chapter and eases between neighbours with a smootherstep curve, so moves start and land without a jolt. Each chapter is one and a half screens of scroll, the copy stays pinned while the camera moves, and a bird's-eye site view bridges the street-level opening and the flat plan.
- The plan view is the house's own edges (
EdgesGeometry of every building mesh, merged into one line draw) over a grid on graphite. The house sinks below the ground first, then the lines draw in, so the two never overlap. - Assembly raises nine groups out of the ground in site order: garage, tower, core, wing, roofs, openings, lamps, snow, yard.
- A mouse leans the camera slightly toward the cursor in every chapter; in the last one a drag turns the view (and tilts it with a mouse), and a flung turn coasts to a stop.
- The clay versus finished comparison renders the scene twice per frame with the scissor test, the left part with one clay material over everything and a studio background.
- On wide screens the frame slides sideways (
setViewOffset) so the house sits beside the chapter copy; on tall screens it slides up above the copy panel and the camera pulls back so the house stays in frame.
Performance
- The high tier uses a 2048 shadow map that only re-renders when the house moves or the light changes. Phones and low-core devices start on the low tier: no shadow maps, half-size textures, fewer trees, bulbs and snowflakes, pixel ratio capped at 1.5.
- Snowfall is one
Points draw whose fall and sway run in the vertex shader. - Rendering stops when the canvas is off-screen or the tab is hidden, and the poster replaces the canvas if the WebGL context is lost.
- Under reduced motion the chapters change in one cut behind a short fade, the snow stands still and there is no camera drift.