- Home /
How do I get rid of seams that are showing up with lightmapping?
So, I'm using Unity 5 and when I put my lights into my scene with my modular enviroment pieces assembled into several buildings I get these seams between wall pieces that are not there then the lighting is not on. Is there a way I can fix this?
@mdagreda I have the same issue with some walls that have been quintuple checked to be perfectly straight and snapped together on the grid. Certain walls work ok, while others have a very visible seam under similar lighting situations. The only way I've been able to solve this is by not making modular pieces, which is obviously not a solution.
Answer by nesis · May 28, 2015 at 12:00 AM
Try combining meshes. This will force Beast to have the same lightmap across the surfaces where possible.
Also, try increasing your lightmap resolution. The result should roughly be smoother gradients across similar adjacent surfaces.
For combining meshes, there's a Unity utility script that you can import called CombineMeshes. If it's not in Unity 5, you can probably Google to find it.
I am using unity 5 so I did not think it was using beast. Also is there a way to combine the meshes when they are modular pieces I used the build the environment and I want to keep the ability to adjust the pieces individually?
$$anonymous$$y mistake about Beast :) in my defense, I hadn't had my morning coffee yet!
Unless you're confident with scripting to create something to toggle between the combined meshes and their separate counterparts, I can't think of a way to do what you're wanting...
Well, actually, one workaround would be duplicating your scene when you want to bake lightmaps, and combining meshes there. Then each time you make changes, you Save As over the duplicated scene, combine meshes and re-bake.
Would be nice for this to be an automated step. I wonder if there's a solution on the asset store...?
Answer by madden90025 · Feb 01, 2016 at 12:18 AM
@mdagreda I have been seeing this in the map I am working on as well. I have a modular set of walls I got from the asset store. One of the things I noticed when trying to fix this problem is that some of my meshes ended up getting strange rotation properties from Unity (359.99 instead of 360, or 0.0001 instead of 0) When I went through and corrected these rotation abnormalities it fixed some of the seams. There are still a few seams that are there and I am trying to figure those ones out.
Answer by mezzostatic · Jan 01, 2017 at 09:20 AM
If you send mesh objects with different positions to the graphics card, unity's precision is not high enough and the actual vertex positions in the graphics cards, the seams, will not be the same. hence you will see seams inside the graphics card. the further you go from origin, the bigger the rounding error will be.
If you put all your cubes on 0,0,0 and instead change their vertex positions to the positions you want, and send them all to the graphics card, they will not contain seams. they will have identical object position and seam position rounding errors sent to the graphics card.
AFAIK i solved the issue after some time and puzzling, perhaps waster 50 hours to solve it, becaues i was told that my problem was inside the game engine not the graphics card.
So... keep all cubes on zero zero zero, edit their vertex positions, rewrite all the vertices to the new positions you want the cubes to be in, otherwise the seam positions in the graphics card differ microscopically.
Its a weird error inside Unity that no one else than me knows about because i am a lame coder who never managed to code a game but i am basically a genious:) iT WOULD HAVE HELPED ME TO FINISH A GAME IF UNITY TOLD US ABOUT THIS ERROR IN THE FORUMS!!!! NOT ME HAVING TO DETECTIVE IT!!!!
Answer by Harardin · Jan 01, 2017 at 04:45 PM
Try to use a light gray color as a background color in your texture when making it in PS or GIMP it helped me to get rid of seams.