Help with baking ambient occlusions for my game?

So I have a gun model (lol its not to good) but whenever I bake the ambient occlusion for it I get weird lines at places where there shouldn’t be and dark spots at places where there shouldn’t be (look at picture below)? How do I fix this?

I believe you can set the margin higher to fix those lines. The margin is the little slider at the bottom of the screenshot you posted. I believe you can also shuffle the UV map islands around so that they’re not so close together that the colors ‘bleed’. You can do this yourself, or by changing the values you enter if you choose to ‘Smart UV Unwrap’ the mesh.

I tried moving the margin slider but it still didn’t do anything?

You moved it higher? Then try the second method I mentioned. What does your UV map look like?

Maybe posting the .blend would allow us to look for ourselves what
might be happening to cause this… would you be willing to post the .blend?

M1911.blend (806 KB) (use this one, you might have to re-bake the top part)
sure heres the blend and solarlunar whenever I smart uv unwrap it it doesn’t randomize it keeps it the same. There is another dark spot underneath the gun in front of the trigger. And also I am not sure if this is something I am doing wrong but this happens to me almost every time I bake an ambient occlusion in blender. And lol hope I am not asking for too much but is there any way to reduce the poly count without making it look bad?


M1911.blend (592 KB)

Ok I’ll have a look at it tomorrow (I’m not able to use my computer all day today due to repairs being done. :confused: )

you got some problems in that model:
-there’s flipped normal issues, you get artifacts because of that.
-on some places you have overlapping geometry (for example look at the tray where the shells come out after shooting a bullet)
-or edges, which have 3 faces connected to them, try to stay close to a manifold only mesh (no splits, generally closed mesh with no holes)
-internal faces, which can also mess with your AO baking

OK yea I didn’t know how to fix the overlapping there but I found a solution and I didn’t see the flipped normal before but I see them by the tray now it fixed the dark spots but what about the random lines on the top?

if the normals are not inverted, one reason could be that the baking margin or your texture resolution are too low. what resolution has the image you’re baking to? and what margin are you using? and make sure your uv image islands are separated by more than what your baking margin is though (better 2x that), so you don’t override already baked stuff.

edit: if you can’t fix it, it’s probably easier to just use texture paint and clean it up by hand. (use clone brush and try to paint over all the lines)