Hi, after hours of trial and error I am at a loss with this lightmap issue. I have a fairly empty, large scene with some low/medium resolution lightmapped meshes. When I bake lighting, it appears perfectly fine on almost the entire scene apart from a hard cut-off point a certain distance away from 0,0,0. Both large and small meshes beyond that point are covered in bake artefacts. It has a similar appearance as having incorrect or overlapping UVs. I have tried baking with the CPU and GPU progressive lightmapper and have observed the same result on both. Increasing samples and texels per unit also doesn’t seem to help the issue. I have tried baking at 1024 and 2048 lightmap resolution and I am unable to bake at 4096 at anything other than low quality. My scene is about 4,600 units along the longest axis. Rotating the large dome mesh produces the same result in the same region, regardless of the mesh itself. The pillars are also separate meshes and are still affected. I am on Unity version 2021.2.6f1 using the HDRP. Does anyone know what’s going on here? Any help or pointers would be appreciated, thanks
Here is an image showing my issue after baking with the GPU progressive lightmapper
Here is the lightmap result
This is an example of one of the higher lightmap settings I tried to see if it would reduce the appearance of the errors (it did not)
UV overlap
Here is a CPU progressive bake. As you can see, the issue persists
Hi. How big is the dome model?
Most likely the issues you encountered are caused by the large size of your dome. If possible, try to break the dome model into smaller pieces.
But also, yeah, I don’t think it’s possible to bake something this big without issues. Lightmapping starts producing artifacts far away from the origin.
I first tried with the whole dome as one model. After getting these artefacts I broke it down into two halves and re-did their lightmap UVs (with no perceivable change). What’s odd is that it also produced bake errors on smaller pillar models when I added those around the edge of the ring.
I would say this is worth a bug report, but please be warned that you might want to find a workaround anyway (like… scaling down the object, baking it, then scaling up at runtime?) since even if this is a fixable bug, a fix for it may arrive in a Unity version you can use in 6 months or a year or something.
Thank you, I might just have to come up with something like that. The weird part is I have other scenes of a similar scale that aren’t getting this issue. However they are uniformly spread out from the origin as opposed to all being off in one axis. I will submit a bug report.
I have set up a similar scene with the same assets in a blank HDRP project and reproduced the same results first time. I submitted the bug report and the ID is 1390059_cndjvr8d7f3i2n3a
(just small side note, that isn’t a link to the issue tracker, which is public, that’s a link to fogbugz which isn’t quite as public, and it has the often undesired side-effect that people can access all other bug reports you’ve done from it, which may be a problem if at any point in the future maybe you say something semi confidential in a bug report. I’m just saying you may want to consider just posting the number here and removing the link)
I wanted to provide a quick update regarding this issue. We have discussed this issue internally. As noted in another thread, which @AcidArrow has linked to, it is caused by 32 bit floating point precision errors. This means that large scenes, and objects placed away from world origin (0,0,0) will exhibit lightmap artifacts.
We are planning on addressing it as part of the upcoming unified baking backend work. We cannot provide the ETA, unfortunately.