Dev Blog

How I Rebuilt My 3D Portfolio with Blender and Three.js

By · · 9 min read

How I Rebuilt My 3D Portfolio with Blender and Three.js

My portfolio has always been a 3D site: you scroll, and a camera flies through a little world. For V2 I wanted a bigger, richer world. Five scenes, around sixty hand-built props, soft sunlight and bounce light that looks like a proper Blender render. And it still had to run smoothly in a browser, on an ordinary phone.

That's the problem every 3D website runs into. Real-time lighting in the browser is either cheap and flat, or pretty and slow. Soft shadows, light bouncing off an orange wall onto the ceiling, round windows throwing patches of low sun across the floor: a phone can't compute that sixty times a second.

So I didn't ask it to. This is how I rebuilt the site in November 2026 with Blender, Python and three.js, using the baking workflow I learned from Bruno Simon.

The idea: compute the light once, then just draw it

If you've seen Bruno Simon's portfolio or taken his Three.js Journey course, you know the trick. All the lighting is computed once in Blender with Cycles and painted into textures. The browser then only draws textured, unlit triangles with MeshBasicMaterial. No lights, no shadow maps, almost no shader cost. The site looks like a Cycles render because, texel by texel, it is one.

Bruno is the reason I build 3D for the web the way I do. V2 follows his baked low-poly workflow. What I added is mostly automation, and a lot of quality control around it.

The V2 world in numbers:

  • 5 scenes: an entrance plaza, a studio, an "automation line" gallery, a story and knowledge room, and a finale on a sunlit terrace
  • about 60 low-poly props, all built in code
  • 17 baked texture atlases
  • three.js r159, GSAP ScrollTrigger, and Lenis for smooth scrolling

One rule on the three.js side: show the bake untouched. The textures leave Blender already tone mapped and display-encoded, so the site must not convert or tone map them again. (Why that matters so much is in the black seams post.)

renderer.outputColorSpace = THREE.LinearSRGBColorSpace; // write texels out as they are
map.colorSpace = THREE.NoColorSpace;                    // don't sRGB-decode the baked atlas
map.needsUpdate = true;
// and leave renderer.toneMapping at its default, NoToneMapping

Everything is built by one Python script

I never hand-edit the .blend file. The whole world (rooms, props, lights, camera, animation) is built from an empty scene by one Python script, run headless in Blender:

blender --background --factory-startup --python build_world.py -- --mode preview --palette sunset
blender --background --factory-startup --python build_world.py -- --mode bake --palette sunset

That sounds like extra work. It's the opposite. A full bake takes about 45 minutes on an RTX GPU, and I baked many times. With a script, every fix is permanent: a wall I fixed in an early bake is still fixed in bake 13. Every bake is reproducible, and every decision has a comment next to it saying why, so nobody "simplifies" it back later.

Preview mode renders key frames through the site's camera, unbaked, in about 3 seconds each. That's where composition happens. I fix layout in previews, never after a 45-minute bake.

Low-poly props that look designed, not default

Every prop is a handful of primitives with a small rounded bevel on its edges. That soft edge is most of what makes low-poly look hand-made instead of "default cube", because it catches a highlight in the bake. The box helper adds it by default:

if bevel is None:  # V1-style soft edges: every block gets a small rounded bevel
    thin = min(size)
    bevel = min(0.14, 0.2 * thin) if thin >= 0.15 else 0.0

Props are designed at unit scale in their own local frame, front facing local -Y, then placed with a location, a scale and a point to look at. Usually that point is where the camera sees the prop best. The friendly robot, for example, is a base, body, chest plate, neck, head, visor, antenna, two glowing eyes, ears and two arms, one of them waving. Plain palette colours, one accent, and warm dark brown instead of black.

At the end, a clean-up pass applies every modifier, merges doubled vertices, dissolves zero-area slivers, deletes duplicate faces and shades curved surfaces smooth by angle (35°).

Groups and atlases

Baking every object on its own is slow and wastes texture space. Instead, every object is registered in a bake group by region:

  • {room}_shell: walls, floor, ceiling
  • {room}_props: everything static
  • {room}_anim: anything that moves

Each static group is joined into one mesh and baked as one job into one atlas. That alone took a full test bake from about 85 minutes to about 8 at low samples. Animated objects stay separate (they need their own transforms) but share their group's atlas.

Sizes that worked: 2048 px for props and most shells, 4096 for big, very visible shells, 1024 for small animated groups. Dense clusters of small close-up props, like a tech desk or a wall of advertising icons, get their own 2048 atlas instead of sharing with big walls. That's how the world ended up at 17 atlases.

Two details made the atlases noticeably sharper:

  1. Texel weighting by camera distance. Before packing, the script scales each UV island by how close the scroll camera ever gets to it. A prop you pass right by gets sharp texels; a far wall doesn't waste them.
  2. Culling faces nobody sees. The script samples the camera path at every frame and ray-casts toward each face. Faces the camera never sees (wall backs, undersides) are deleted before unwrapping. It keeps a one-face safety ring around everything visible, and never trims text, books or signs.

Glowing parts (lamp globes, the robots' eyes) are not baked at all. They become flat unlit colours, so they don't hog atlas space or smear light into their neighbours.

A camera that follows the scroll

The fly-through is one Blender animation, CameraAction: frames 0 to 265 at 24 fps, keyed on an empty that the three.js camera is attached to. The Blender camera uses a 50° vertical field of view, which is the three.js PerspectiveCamera default, so what I preview in Blender is what the browser shows.

The path is a Catmull-Rom spline through a handful of control points, sampled into one keyframe per frame. In the browser, GSAP ScrollTrigger scrubs the clip's time instead of playing it:

gsap.timeline({ scrollTrigger: {
  trigger: renderer.domElement, start: 'top top', end: '+=900%', pin: true, scrub: 1.25,
}}).to({
  get time() { return camMixer.time; },
  set time(v) { camAction.paused = false; camMixer.setTime(v); camAction.paused = true; },
}, { time: camClip.duration });

Nine screen heights of scroll drive the whole flight, and the playhead catches up over 1.25 seconds, so the camera glides instead of jumping. Lenis smooths the mouse wheel on desktop.

One lesson worth stealing: hang everything on camera progress, not on scroll pixels. The page text for rooms 1, 2 and 3 appears at 14%, 34% and 56% of the camera clip. Change the scroll length or the easing, and the text still lands in the right room.

Reusing the V1 terrace for the finale

V1 ended on a stepped circular pit on a sunlit terrace, and I didn't want to lose it. So V2 ends there too. The finale imports V1's terrace as-is, and from frame 182 the camera is V1's own camera: same path, same orbit. Between frames 150 and 182 the V2 camera eases into V1's exact attitude, so the hand-off is invisible.

Old geometry needed care. V1's export had left almost every face disconnected, over 2,000 loose pieces on the floor alone, which would have meant thousands of UV seams. The script welds it back together on import and clears the custom normals so smooth-by-angle decides the shading. It never culls this geometry, and it flips the faces the camera only ever sees from behind (234 of them, which had baked black).

New props stand on the pit's pedestals: the waving robot, a laptop, a dashboard, a pair of meshing gears, a globe, a hovering rocket and a server rack, with chat bubbles, a lightbulb, an AI chip, a cloud and a chart orbiting slowly overhead. Their positions are measured from V1's pedestal tops, not guessed.

End-of-scroll view of the finale: V1's circular terrace pit in sunset tones, with the waving robot, a gear pair, a server rack and the back of a standing dashboard on the pedestals

The last camera frame is where visitors rest, so I composed for it. The gear stand faces that camera, and it sits low enough that from there the gears are below the robot instead of across its body.

Palettes and grades chosen from pictures

Every colour in the world comes from a palette: a dict of named roles (floor, wall, accent, dark and so on) plus a lighting dict (sun colour, strength and angle, sky colour, glow level). The script takes --palette and can bake four looks without a code edit:

  • sunset: V1's own terracotta, apricot, sand, mustard and olive under a low golden sun
  • dusk: V1's warmth with lilac shadows and a violet sky
  • sage: clay, sage and cream in soft daylight
  • midnight: the first V2 idea, an indigo night with neon mint and coral

The page's theme has to match the baked palette, because the room's colours and light live in the textures, not in code.

I don't choose between looks by describing them. I render them side by side and pick. For the colour grade, that meant the same three frames under three AgX looks:

Three colour grade options for the baked world, three frames each: AgX Base Contrast, AgX Medium High Contrast and AgX Punchy

Base Contrast was the cleanest but a bit pale. Punchy brought the darkest shadows back. Medium High Contrast at exposure 0.7 was richer without crushing anything, and that's the one I went with. The grade is a command-line flag (--look, --agx-exposure), and every bake also saves its atlases as HDR EXR files, so a future regrade is a re-export rather than a 45-minute re-bake.

What I'd do next time

A few upgrades are queued for the next round: KTX2 textures for less GPU memory on phones, half-size atlases for mobile, matcaps for animated objects so moving things never carry baked shadows, and Bruno's palette-texture approach with light-only bakes for crisper colour edges.

Takeaways

  • Bake the lighting in Blender and draw it with MeshBasicMaterial. Then show the textures untouched: no colour conversion, no tone mapping.
  • Build the scene from a script. Every fix becomes permanent and every bake reproducible.
  • Preview in seconds, bake in the background. Never bake just to test a layout.
  • Group by region (shell, props, anim), one atlas per group, and spend texels where the camera goes.
  • Drive the camera with scroll, but hang text and effects on camera progress.
  • Design for the last frame. That's where visitors stop and look.
  • Choose palettes and grades from side-by-side images, then make the choice a flag.

The bake had its own battles: black seams, muddy corners, and a dark spot that travelled around a spinning gear. I wrote those up in Why Your Baked Textures Have Black Seams. The realistic product section got a separate treatment, covered in Restyling a 3D Product Showcase.

Want a 3D website like this?

If you run a business and want a website people actually remember, this is what I build: 3D interactive websites that load fast, look like a render and tell your story as visitors scroll. I'm a software engineer and web developer based in the Philippines, and I work with clients on 3D websites, e-commerce, branding and web apps. Tell me about your project and let's plan a 3D website for your business.