Why Your Baked Textures Have Black Seams (and How to Fix Them)
You bake lighting in Blender, load it in three.js, and it looks great. Until you look closer. Thin black lines along UV seams. Dark halos at the edges of shapes. Corners gone muddy brown. A dark smudge that slowly travels around a spinning gear.
I hit all of these while rebuilding my portfolio, a scroll-through world of five scenes and 17 baked atlases. The usual advice is "increase the bake margin". That helped a little. The real causes were spread across tone mapping, denoising, empty texels, materials and geometry.
After fixing them, the "dark lighting" pixels in one room (bright materials rendered near-black) dropped from 40,846 per frame to 877. In the entrance plaza, from 12,458 to 403. Below is every cause I found, in the order I'd check them. If you're new to the baking workflow itself, start with how I rebuilt my 3D portfolio with Blender and Three.js.
1. Let Blender do the tone mapping
This was the biggest single fix. My first pipeline baked HDR lighting and pushed it through a hand-written ACES curve in Python. It crushed every shadow to near-black and over-saturated the warm colours. A lot of what I'd been calling "dark patches" was simply the curve.
Bruno Simon's workflow saves bakes through Blender's own view transform (Filmic in his course, AgX in current Blender). I did the same, in code: write the HDR pixels into a float image, switch the scene's view transform to AgX, and save it "as render":
vs.view_transform, vs.look, vs.exposure, vs.gamma = "AgX", AGX_LOOK, AGX_EXPOSURE, 1.0
st.file_format, st.color_mode, st.color_depth = "PNG", "RGB", "16"
img.save_render(path, scene=sc)
out = bpy.data.images.load(path)
out.colorspace_settings.name = "Non-Color" # read back the encoded values as-is
The script restores the scene's view settings afterwards. Now the atlases match what Blender shows in its own renders.
Then the browser has to show those values untouched. If your site looks darker or more contrasty than Blender, you're probably converting or tone mapping twice. In three.js r159:
renderer.outputColorSpace = THREE.LinearSRGBColorSpace; // output as-is
map.colorSpace = THREE.NoColorSpace; // undo GLTFLoader's sRGB tag on baked maps
map.needsUpdate = true; // and no renderer.toneMapping
2. Turn off Cycles' bake denoiser
Cycles' built-in denoising darkens the margins around UV islands, and dark margins are black seams. I switched it off and denoise myself with OpenImageDenoise through the compositor, guided by baked albedo and normal passes in the same UV layout.
sc.cycles.use_denoising = False # Cycles' bake denoise darkens margins -> black seams
bpy.ops.object.bake(type="COMBINED", pass_filter={"DIRECT", "INDIRECT", "DIFFUSE", "EMIT"},
margin=16, use_clear=True)
The guides are cheap: 16 samples each. Albedo is a diffuse colour pass; normals are baked in object space and converted from 0..1 to -1..1 for the denoiser. The compositor runs Image → Denoise (prefilter Accurate, albedo and normal linked) → Composite at atlas size. No scene render happens. Without the guides, the denoiser smears detail. With them, colour and shape edges stay crisp.
3. Fill the empty texels, before and after denoising
An atlas is islands floating in black. Two things look at that black:
- The denoiser. It blends neighbouring pixels, so it pulls black into island edges. Result: dark rims and halos.
- The browser's mipmaps. At a distance, the GPU averages texels, so island edges mix with the black around them. Result: thin dark lines along every UV seam, worse the further away you are.
The fix is a push-pull fill. Shrink the image level by level, averaging only real (baked) texels. Then expand back up, giving every empty texel the average colour of the nearest baked ones. It's about fifteen lines of NumPy, and I run it twice:
prefill(img, baked, size) # before the denoiser sees black
px = fill_gaps(denoise(img, size, alb, nrm), baked, size) # and after, for the mipmaps
baked is simply every texel that came out of the bake non-zero: the islands plus Cycles' margin.
4. Margins: 16 px, adjacent faces, and room to breathe
Margins still matter. They're just not the whole story. What worked:
- a bake margin of 16 px with the margin type set to
ADJACENT_FACES, so the margin continues the neighbouring face across the seam instead of smearing the edge colour outward - islands packed with a 12 px gap (
margin=12 / size, as a fraction of the atlas) - enough resolution per group: 2048 for props, 4096 for big shells
A crowded atlas is a blurry, seamy atlas. A 66° angle limit in Smart UV Project helped too: a bigger angle means fewer, larger islands, so fewer seams on rounded shapes.
5. Stop bounce colour from building up
My sunset rooms are orange. Light bouncing between orange walls picks up more orange with every bounce, so ceilings and corners compounded into a deep red-brown. It reads as dirt.
The fix is to desaturate the base colour for bounce rays only. Every material gets a mix between its colour and that colour's luminance grey, driven by Light Path → Is Diffuse Ray, multiplied by 0.7. Camera rays still see the true colour, but bounced light carries a mostly neutral tint. A soft area light near the floor of deep rooms (a "bounce" light) and a lighter ceiling colour finish the job.
6. No near-black materials
On an unlit website, a near-black surface and a bake error look identical. Visitors can't tell "this robot's base is meant to be black" from "this face baked wrong". I replaced every black with warm dark browns (#74503f and #6a4434 in the sunset palette). In a warm scene it simply looks better, too.
7. Overlap geometry at junctions, never butt it
Two of my "seams" weren't texture problems at all:
- Sky through a crack along the wall base. The floor stopped at the wall's inner face, and at some angles the gap showed the background.
- A dark groove along every join. Each wall's bevel met the floor's bevel at a butt joint, leaving a small V-shaped trench that baked dark.
Now floors run under the walls to their outer faces, and walls are 0.5 taller so they sink 0.25 into the floor and the ceiling. The bevels get buried:
box(f"{prefix}_floor", (W + 1.6, L, 0.6), (0, cy, -0.3), floor, group)
# walls reach 0.25 into the floor and ceiling: their bevels are buried, no groove or crack at the joins
box(f"{prefix}_wall left", (0.8, L, H + 0.5), (-W / 2 - 0.4, cy, H / 2), wall, group)
8. Stairs as one solid
Stairs made of stacked boxes have internal and coplanar faces, and those bake as cracks and noise. My staircase is one closed solid: the side profile drawn as a single polygon, then extruded across the width. No hidden faces, no shared faces, nothing for the bake to fight over.
9. Boolean before bevel
Arched doorways are walls with a boolean cut. With the bevel applied first and the boolean second, the cut sliced through bevel geometry and left about 1,600 broken faces: slivers and degenerate faces that baked as random black specks. Order matters:
m = target.modifiers.new("cut", "BOOLEAN")
m.operation, m.object, m.solver = "DIFFERENCE", cutter, "EXACT"
bpy.ops.object.modifier_move_to_index(modifier=m.name, index=0) # cut first, bevel the new edges after
bpy.ops.object.modifier_apply(modifier=m.name)
10. Nothing static inside a spinning object
This one is sneaky. In the finale, a gear spun on a static post that passed right through it. The bake painted a dark contact patch onto the gear where the post touched it, and then the patch spun around with the gear and rotated into view at the top.
The rule: anything a mover passes through bakes onto it. Now each gear is held by a post standing behind the gear plane, with a short pin that ends just inside the hub's back face. A round, centred contact is invisible while spinning. The two gears also truly mesh now: the same tooth size, phased so a tooth of one points into a gap of the other, and spaced so they never touch over a full turn.

The same before/after shows a cousin of this bug. The thin dark "rod" down the drum wall was a server rack's corner poking out. The rack had been placed on a hidden lower floor inside the drum, so most of it was buried. Standing it on the real drum top, well inside the edge, fixed both the stray brown box and the rod.
Two related rules:
- Moving objects never cast shadows or bounce light onto static ones during the bake (
visible_shadow = visible_diffuse = False). Otherwise their shadow stays painted on the floor while they move away. - Smooth low-poly shapes get
shadow_terminator_geometry_offset = 0.5, which removes the jagged dark terminator line.
11. Verify from the real camera path
"It looks fine to me" is not evidence. After every bake, a chain of checks runs in the background, so the results are ready when the bake is:
- An audit. Render the exported model through the site camera at the same 16 frames every time, unlit, with a magenta background so holes stand out. Compare against the unbaked material colours and classify every dark pixel: a hole, a dark material (a design choice), dark lighting (a bright material rendered dark), or crushed (far below its own material's brightness).
- Path close-ups. For each prop, a telephoto shot from the exact point on the camera path where a visitor sees it best.
- A clash check. Every interpenetration between objects through the whole animation, with heights to tell contact from clipping. Across the world it listed about 760 pairs. Almost all were intended contact; 5 were real, including a tree crown through a mezzanine slab and a fairy-light bulb inside a book.

Judge only from viewpoints a visitor can reach. Orbit around a prop and you'll "find" missing faces that were culled on purpose, because no camera ever sees them.
One trap with the numbers: a colour-grade change moves them on its own. Switching from AgX Base Contrast to Medium High Contrast raised dark-lighting pixels 4-8x in the orange rooms with no new artifact, because saturated orange has lower luminance and contact shadows get deeper. Compare bakes at the same grade.
And test cheaply before you bake: a preview frame takes about 3 seconds, a clash check about a minute, a full bake about 45 minutes on an RTX GPU.
Takeaways: symptom → fix
- Shadows near-black, colours over-saturated → tone map through Blender's AgX with
save_render, not a hand-written curve. - Black seams that look like margins → Cycles' bake denoiser off; OIDN with albedo and normal guides.
- Dark rim just inside island edges → push-pull fill before denoising.
- Thin black lines, worse from far away → push-pull fill after denoising, for the mipmaps.
- Seams at UV edges in general → 16 px margin,
ADJACENT_FACES, a 12 px packing gap, enough resolution. - Red-brown ceilings and corners → desaturate bounce rays (Is Diffuse Ray), add bounce lights.
- "Is that black on purpose?" → warm dark browns, never near-black.
- Cracks or grooves at wall bases → floors under walls, walls sunk 0.25 into floor and ceiling.
- Noise and cracks on stairs → one extruded solid.
- Random black specks on cut walls → boolean before bevel, then clean degenerate faces.
- A dark spot travelling around a spinner → nothing static inside a moving object.
- Site darker than Blender → no double tone mapping or sRGB conversion in three.js.
Above all, fix the cause in the build script, never by painting over the texture. The next bake brings the bug right back.
The live-lit product section had different problems entirely: see Restyling a 3D Product Showcase.
Want a 3D website that looks polished on every frame?
Clean bakes are the difference between a 3D site that feels premium and one that feels a little broken, even when visitors can't say why. This is the level of detail I bring to client work: 3D interactive websites that look like a render, load fast and hold up from every angle the camera reaches. If you want one for your business, let's talk about your project.