I rebuilt my portfolio, and it walks you through a forest.
Scroll the homepage and you walk a path from a golden afternoon into night. Each stop on the path is a section of the page: what I do, the work, DateNight, the tools I build, a little about me, and a campfire at the end where you can say hello. It’s made with three.js r187 and no framework. The rest of the site is plain HTML.
I wanted the first page to be memorable and every other page to be calm and easy to read. So the forest lives only on the homepage. Every case study is a plain, light page.
No texture files
Every tree, root, lantern and creature is drawn with Canvas 2D when the page loads. There are 18 painters: old broadleaf trees, cedars, dead trees, ferns, grass, rocks, a signpost, a cabin, a lookout, a sapling, lantern posts, a waypost, a campfire, and a few things I won’t spoil. Each painter takes a seed, so the same seed paints the same tree on every visit, and the forest is planted from a seeded random stream too. It grows the same way every time.
Each painter draws four greyscale layers and packs them into one RGBA texture:
- A · MaskThe silhouette itself.
- R · WarmParts that glow peach: lantern paper, cabin windows, embers.
- G · GlowParts that glow green: fungi, root veins, eyes, spores.
- B · DetailBark cracks, hollows and wood grain. The shader darkens these.
Lighting happens later, in the shader. That’s the point of the split: one texture can be lit differently wherever it stands. The same tree catches a low gold sun on its edges in the afternoon, cold teal moonlight at night, and a lantern’s warm light up close.
The packing step is a few lines. It reads the four canvases and writes one buffer, flipping the rows for WebGL on the way:
// Pack the four layers into one texture (rows flipped for WebGL)
out[dst + x] = Math.min(R[src + x + 3], a); // warm
out[dst + x + 1] = Math.min(G[src + x + 3], a); // glow
out[dst + x + 2] = D[src + x + 3]; // detail
out[dst + x + 3] = a; // mask
Painting 30-odd textures takes a moment, so it runs in background workers with OffscreenCanvas, and the page stays smooth while the forest is made. The arrow boards on the waypost are the exception. They carry words, so they wait for the page’s fonts and are painted on the page itself.
A 2.5D diorama
The forest is painted cutouts standing on flat planes, like a stage set. There’s one InstancedMesh per texture, so every tree that shares a texture is drawn in a single call. The cutouts stand in three bands: giants beside the path, a middle band, and fog silhouettes far back. Each one sways a little from the top, at its own rhythm.
When you step off the path, the cutouts turn with your view, so they never go paper-thin.
One shader for the whole sky
The sky is a single shader: a gradient, stars, a low sun and moon, drifting cloud, and three ridges of mountains with a fringe of distant conifers. It’s drawn from the true view direction rather than painted on a backdrop, so it stays put in the far distance while you walk and turn.
The light changes as you walk. It’s late golden afternoon at the start, sunset at the grove, blue hour by the sapling, and full moonlit night from the workshop on. The opening is welcoming on purpose. The uncanny things only start past the sapling.
Walking, not scrolling
Scrolling doesn’t move the camera directly. It sets where the walker is headed, and the walker gets there at a walking pace, however fast you scroll. The only time it hurries is to catch up after a long jump, like following a link in the nav. A section’s card only appears once the walker has actually arrived at its stop.
The work, grown as trees
The grove is where the case studies live. Each project is a tree, and its height comes from its impact:
const h = 7 + pr.impact * 5.2; // impact in millions
Pay-in-Full, at $4M, is the tallest tree in the grove. A waypost at its edge carries one arrow board per project, and the boards are the links. Hover a project in the card on the page and its board and its tree light up.
Wander mode
A button lets you leave the path. On a desktop, WASD or the arrow keys walk and dragging looks around. On touch, you hold and drag like a thumb-stick. Off the path the walk is slower and freer, and there are things to bump into: trunks, the cabin, rocks, the fire.
A couple of easter eggs are hidden off the path. Finding things adds to a small log of field notes, kept only in your browser. One of them leads somewhere else entirely.
Complete without JavaScript
Every stop on the walk is real HTML. Search engines, screen readers, and anyone with scripts turned off get the whole page. The forest is only ever added behind the words. A few more rules kept it fast and polite:
- It runs only when it can. It needs WebGL2, and if your system asks for reduced motion, the page skips the walk and stands on its own.
- You can opt out. “Skip the walk” stops rendering, and the page remembers the choice.
- Words first. The scene loads once the page is idle, after the text has painted.
- No big first frame. Shaders compile in the background where the browser supports it, and textures go to the GPU a couple at a time.
- Small for what it is. The whole forest, three.js included, is about 170 KB gzipped.
The homepage also comes in German and French. All three are generated from one template, so the forest is the same in every language.
What I’d like to hear
If you’re curious about the painters or the cutout shader, I’m happy to go deeper. And if the forest stutters on your hardware, I’d really like to know which device and browser. Send me a note.