# Dark edges in baked texture

**URL:** <https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136>\
**Category:** Content creation (3dsMax, Maya, Blender, glTF)\
**Tags:** blender, lighting\
**Created:** [July 13, 2022, 2:49pm UTC](https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136 "2022-07-13T14:49:33Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![jellix](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jellix](https://forum.babylonjs.com/u/jellix)\
**Post date:** [July 13, 2022, 2:49pm UTC](https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136/1 "2022-07-13T14:49:33Z")

</div>

Hi,

I know that it’s a blender-question. But some of us may have had the same issue.  
After baking the scene and importing it into babylon I see dark edges.

 ![dark-edges](https://us1.discourse-cdn.com/flex024/uploads/babylonjs/original/3X/2/5/253b57d0fe1464ec9d94e34263e32e7833c1a55b.jpeg)

In Blender there’s a “Margin” option at the baking-section. And it’s set to 16px.  
Nevertheless I don’t get rid of this. I know about the principles of light-baking in blender and already tried a lot. But I don’t find a way. And I don’t want to tweak the rendered image in Photoshop.

Maybe somebody has a hint for me? 🙂

---

<div class="post-metadata">

**Author:** ![kvasss](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kvasss/32/3774_2.png) [@kvasss](https://forum.babylonjs.com/u/kvasss)\
**Post date:** [July 14, 2022, 12:41pm UTC](https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136/2 "2022-07-14T12:41:19Z")

</div>

Hi. I think you need padding or something like this, because marign its outside distance between islands

---

<div class="post-metadata">

**Author:** ![jellix](https://avatars.discourse-cdn.com/v4/letter/j/46a35a/32.png) [@jellix](https://forum.babylonjs.com/u/jellix)\
**Post date:** [July 15, 2022, 8:49am UTC](https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136/3 "2022-07-15T08:49:53Z")

</div>

Hi kvass, yes, that would be exactly the setting I’m looking for. Technically it’s doesn’t exist because the black areas are really rendered as black content (because no light is landing there) while the margin areas are free and can be filled with the margin.

---

<div class="post-metadata">

**Author:** ![kvasss](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/kvasss/32/3774_2.png) [@kvasss](https://forum.babylonjs.com/u/kvasss)\
**Post date:** [July 15, 2022, 9:00am UTC](https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136/4 "2022-07-15T09:00:58Z")

</div>

i dont use blender for bake textures and this looks scary [texturing - How can I expand the borders of a exture edge outwards like an offset? - Blender Stack Exchange](https://blender.stackexchange.com/questions/121653/how-can-i-expand-the-borders-of-a-exture-edge-outwards-like-an-offset)

---

<div class="post-metadata">

**Author:** ![Pryme8](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/pryme8/32/7212_2.png) [@Pryme8](https://forum.babylonjs.com/u/Pryme8)\
**Post date:** [July 22, 2022, 1:55am UTC](https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136/5 "2022-07-22T01:55:38Z")

</div>

> <https://blender.stackexchange.com/questions/238258/extend-texture-beyond-limits>

I think you are looking for extend, I’m no blender expert but that’s what substance painter and designer uses

---

<div class="post-metadata">

**Author:** ![Philemon13](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/philemon13/32/16418_2.png) [@Philemon13](https://forum.babylonjs.com/u/Philemon13)\
**Post date:** [July 22, 2022, 11:51am UTC](https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136/6 "2022-07-22T11:51:58Z")

</div>

Hi jellix  
You may find a way to your answer in those old article :  
[http://wiki.polycount.com/wiki/Edge\_padding](http://wiki.polycount.com/wiki/Edge_padding)

[http://wiki.polycount.com/wiki/Light\_map](http://wiki.polycount.com/wiki/Light_map)

---

<div class="post-metadata">

**Author:** ![Vinc3r](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/vinc3r/32/25340_2.png) [@Vinc3r](https://forum.babylonjs.com/u/Vinc3r)\
**Post date:** [July 27, 2022, 8:58am UTC](https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136/7 "2022-07-27T08:58:11Z")

</div>

Are your UV islands too close to each others? 'cause with the right margin in the unwrap operation, in combination with the right value for padding in the baking setup (tweaked having the lightmap texture size in mind), I’ve always get rid of this dark edges issues.

little example here (from [my old tutorial](https://www.nothing-is-3d.com/article27/from-blender-to-babylonjs#tocBlenderSideCyclesBaking)):  
[![](https://www.nothing-is-3d.com/data/medias/tutorials/from-blender-to-babylon/lightmaps-baked-and-uv.png) ](https://www.nothing-is-3d.com/data/medias/tutorials/from-blender-to-babylon/lightmaps-baked-and-uv.png)

---

<div class="post-metadata">

**Author:** ![yamaciller](https://sea2.discourse-cdn.com/flex024/user_avatar/forum.babylonjs.com/yamaciller/32/21810_2.png) [@yamaciller](https://forum.babylonjs.com/u/yamaciller)\
**Post date:** [July 27, 2022, 12:15pm UTC](https://forum.babylonjs.com/t/dark-edges-in-baked-texture/32136/8 "2022-07-27T12:15:04Z")

</div>

Hi.  
To me it looks like a UV layout/resolution, precision issue.  
Because the floor does show that - and I assume that there is no UV seam in the floor - where the middle wall is.  
The black edges can be more a seam issue.  
Always look, that you have as little of seams as possible. e.g. a cube can be layed out into 6 sides or into one island. Be sure that your seams are there where u cannot see them,  
Would make sure, that the UVs are not distorted and have the same scalings.  
You might always run into such issues if your UVs do lie within a pixel.  
Probably you can devide larger elemens into smalled UV islands to arange it in the layout.  
Resolution and mipmaps are also always something to look into.  
Best.w.
