In our project we have baked light maps for our scene and everything looks as it should in the editor. However once you press the play button, the UV-coordinates of the light maps seem to become corrupted which makes the scene look pretty distorted. Once you stop the game, everything looks ok again. Are we doing something wrong in generating the light maps or is this a bug? (See attached screenshots).
Do your models have secondary uvs? If not, goto the model importer and check generate lightmap uvs. That’s the only thing I can think of since I had this happen to me too and that fixed it I think.
Actually that checkbox is not ticked here. However as I understand the documentation this should not be necessary if the primary UV channel has UVs that conform to the following restrictions:
Is contained within the [0,1]x[0,1] space
Has no overlapping faces.
Has low angle distortion, that is deviation of angles in UVs and in source geometry.
Has low area distortion, that is, relative scale of triangles is mostly preserved, unless you really want some areas to have bigger Lightmap Resolution.
Has enough margin between individual patches.
I think that our UVs conform to these restrictions. Also it’s pretty weird that in preview everything looks ok but in game it is distorted…
But nevertheless i tried ticking that checkbox on ONE of the meshes we import. This fixed the issue for the WHOLE scene. If that checkbox is really required, I should have had to tick this checkbox on ALL meshes we import. So I suspect there is still some bug in the lightmapping.
Yeah, that’s weird. File the bug case and mention somewhere it is for Alexey or Robert. Don’t forget to attach your project (the smaller repro you can get the better)
Okay, I think is caused somehow by our ground mesh, though I don’t really understand why. But as you can see on the screenshots already, the ground model has some weird rendering artifacts on it. I created a simple demo project and could reproduce it there as well. Bug has been submitted (Ticket-ID: 367899_4qgsf1td)
It looks like a bug in static batching. Objects are being combined but the combined mesh doesn’t respect renderer’s individual lightmap tiling and offset. It should be irrelevant whether you use your own secondary uvs or auto-generate them.