I’m stuck with a really annoying problem. While lightmaps are fine in the editor, they are totally messed up in the build. Realtime light works fine. Anyone’s got a tipp for me to check? Using 5.6.0f3
Happens in all of my scenes with heavy geometry
Happens on enlighten and progressive baker lightmaps
Happens in VR and non-VR
Realtime lit geometry is also affected when a baked lightmap exists (see wind turbine wings)
Does not happen when I partially deactivate lightmapped meshrenderer, but I cannot nail it down to a single mesh/shader/material.
Build:
Okay it’s getting weired now. Seems related to the textures in my project.
I can make the lightmap look correct without rebaking if I remove some meshrenderers in the scene, deactivating does not help. Is there some kind of maximum texture count (size does not matter i’ve already tried reducing all textures to 1024px) for builds?
Did you add second UV Map to your 3D models for the lightmapping to be baked into the texture?
Did you make sure the unwrapping is unfolded and not cut and spread out?
Have you tried switching between forward vs deferred?
Have you tried switching between gamma vs linear?
Have you tried changing from progressive (preview) to enlighten before doing final rendering and build?
Have you checked project - quality settings for any wrong settings?
Have you made a cube inside Unity and checked if the scale of your objects imported into the level is bigger or smaller than the Unity Units?
Done everything sadly. I’m now down to lowering the meshrenderer/vertex count of my scene. This seems to help but I can’t narrow down when this breaks exactly. Thanks for your help!
I’m currently experiencing the same issue on 2017.2p1. None of my attempts to fix this helped.
Did you resolve this issue? If so, how did you do it?
My last guess what might help is to let Unity generate the UV maps.
Since the scene with the issue is a very large one (and strangely the only one in the project), this takes ages to complete. So if there is another fix, it would be great to know.
We did not fix this problem but worked around it. I deleted some meshfilters/renderers in my seen (deactivating does not help) and at some point it worked again.
I suspected an overload in the build data with too much textures/meshes but didn’t manage to pin it down to specific objects or numbers (we had > 15m triangles and a lot of 8K textures).
Your best try is to delete unused gameobjects with renderers/filters on them and build again. Good luck, took me some nights to get a good looking scene with some objects deleted :(.
Edit: We did use Meshbaker for merging geometry but deleting the deactivated originals did not do the job either, I had to remove some of the baked geometry/atlases as well.
Thanks for the help.
Unfortunately I was not able to fix it.
If I delete visible objects my Lead Designer would kill me
My best guess is, that the reason is the Meshmerger/baker, more specifically the lightmap UVs that are generated. And therefore the amount of maps that are generated in the project gets too high.
I’ve had this problem recently. The lightmap was flawless in the editor, but in builds it had bizarre artifacts like blocky textures and patches that were so extremely bright that they’d fill the screen with bloom.
Rebaking and rebuilding seemed to fix the problem… so I don’t know what the heck happened.
As the problem went away I’d have nothing to show, but otherwise this would be great advice.
However, if this does happen again, I’ll be sure to do this.
For anyone happening upon this conversation, I know that “just rebake, rebuild and cross your fingers” isn’t the most satisfying conclusion, but hopefully it’ll be enough to get you through whatever your working on.