Lightmaps look inconsistent between editor and device

I’ve recently upgraded my project to 2.0 from 1.3. In the previous project I was using lightmaps that looked great on device, however after upgrading to 2.0, the lightmaps look like the following.

And in editor:

Is there a new procedure for baking lightmaps in 2.0? Can I bake the lightmap with my shaders plugged into the PolySpatial Lighting node or should they be baked whilst set up as standard lit URP shaders?

Thanks

No new procedure. The most likely culprit if they look different is that you’re using a Lit shader graph target and thus combining visionOS’s image based lighting with Unity’s lighting (that, or you’re using unsupported lightmap settings). With the next release, we’re going to be including a new way to incorporate PolySpatial lighting (light maps, light probes, reflection probes) into shader graphs that uses a data extension rather than the PolySpatial Lighting node. That should hopefully make clearer which types of lights are affecting the shader (Unity lighting, visionOS lighting), will address the issue that the PolySpatial Lighting node doesn’t work outside of builds/play mode, and will prevent any need to switch shaders when building lightmaps.

With the present approach, you may find that you need to build lightmaps with URP/Lit and switch to the shader graph afterwards, perhaps as a build step (as discussed in this thread). However, that wouldn’t account for the difference between the Unity and visionOS views (as they use the same lightmap textures). The first thing I’d try is using an Unlit shader graph target.

Edit: Actually, given that there’s more light in the editor, it may be that the editor is using dynamic lights as well as lightmaps. Another option would be to try enabling dynamic lighting and/or light probes on the PolySpatial Lighting node.

So the difference between 1.3 and 2.0 is that in 2.0 all of these artefacts have started to show up. Previously these lightmaps looked perfect and there were no issues. I also had some clients who viewed my 1.3 build on 2.0 and they could see the artefacts, they are not present on 1.3 however. I’m really stumped as to what is causing the issues now. Is there something on your end that could have caused something to change?

Is there an ETA on the next release? Unfortunately I’m quite pushed for time on getting this sorted.

Not that I’m aware of. If you submit a repro case as a bug report and let us know the incident number (IN-#####), we can look into it.

I’ll see if I can figure it out on my own otherwise I’ll do as you’ve suggested, thanks!

1 Like

I assume you were also using 2022.3 prior to the upgrade, and you’re now on Unity 6? Is it possible this is just an issue with Unity lightmaps, not specific to PolySpatial. Does this happen on other platforms? It sounds like re-baking them didn’t help? Upgrading a major version of the Editor may break things like this, although we generally try to help with the upgrade. I see changes to baking environment probes by default but I don’t think that’s what you’re running into here. In any case, this may get some more visibility with a Global-Illumination tag, as it could just be a bug with upgrading lightmaps between 2022.3 and 6.

To reiterate as I think it’s important: A Vision Pro on OS2 would see the artefacts on a build produced via 2022.3, however a Vision Pro on OS 1.3 would not see the artefacts. It seems the upgrade to OS2 has caused these artefacts to appear. It’s quite difficult to debug as the lightmaps I see produced in editor play mode look perfect but when running on device strange artefacts and shadows appear.

I appreciate any nudging in the right direction as right now I’m just trialing and erroring my way through this but it’s very time consuming.

Thanks

Oh! My mistake. I thought you were talking about upgrading PolySpatial packages and showing that there were also issues in the Editor. If you’re talking about a change caused by the OS version, that sounds like an issue that we should report to Apple.

This is editor play mode:

On device:

Are you seeing the same issues on your end in regards to lightmapping? I’m struggling to see how I’m doing anything wrong here. I’m following the same process pre Vision OS2.

We are not, but we don’t check multiple different permutations of the lightmap settings. This is what our baked lighting sample looks like in editor play mode (the spheres are using light probes/baked GI shader graph nodes, rather than lightmaps, so ignore those):

This is what it looks like in the visionOS simulator:

This is the shader graph:

It’s hard for us to know what’s going on with your case without actually seeing how your project/shaders/lighting are set up. A repro case submitted as a bug report would go a long way.

Ok thanks for that response. I’ve not submitted a repro project before, are there steps somewhere that I can follow?

Yes, the documentation is here.

Hey guys, I managed to fix the issue. I switched light baking to baked indirect rather than shadow masking. I also set models like the floor to generate UV maps on the model import settings. It’s strange that in the previous version of Polyspatial this didn’t seem to be necessary or it might have been upgrading the project reset some values but regardless I’ve managed to generate nice looking lightmaps :slight_smile:

1 Like