Closed jacksandham-va closed 3 years ago
Is it just the scale that causes the issue?, if you set a different scale things work well?
Just to make sure, the lightmap is being applied in the build just not properly? (as in the lightmaps shaders are not stripped in the build , look in the readme).
Also can you reproduce it with a different object? let's say a cube at scale 100 as well?
Thanks for your quick reply.
Yes at scale 1 object is lit correctly (after changing lights to fit scale 1)
Yes checked your readme and have tried various Custom settings for lightmap shader stripping. I can see the lightmap on the object (it just doesn't look right).
I've tried a simpler object and can reproduce as well at scale 100 with slightly different behaviour. Lighting looks different than in editor still but looks almost just like ambient lighting. Whereas my other object you could see the incorrect mapping.
I'm trying a few different things with other light types and scales.
Ok thanks for the info. One last question, this only happens on a build correct? Meaning that in the editor everything looks correct in play mode?
It would be interesting if you could share some pics or a repo project for me to look at too.
Also I wonder if this happens regardless if you try simply lightmapping normally with Unity...
Yes only in build, in play mode it looks good regardless of scale and even in another scene. Actually even at scale one with the other object it still doesn't look the same (think it was false hope) on iOS.
So I think it's an iOS build issue. I've just generated lighting normally with Unity and that's fine. Strange!
mmm, this definitely sounds like an IOS build issue, try doing uncompressed lightmaps, but it is very strange since you mention that you baked normally with unity and it worked. Let me know if you can provide a repo for me to check
Yes these are uncompressed. I think we didn't have this issue in 2019.2 and LWRP 6.9.2 but I will confirm as well. I will try sort a demo scene for tomorrow.
Another note, I can make the editor and iOS behave the same by applying a scale to the lightmap scale parameter. Not sure why...
I've now duplicated behaviour in editor by having a duplicate of the model in the scene. I'm going to try replicate this in the sample scene.
Okay I've found a workaround setup. For the baking side we had to have the original FBX for the model in the scene we're baking, marked as static but without the script. We were original trying to bake onto a prefab that had that fbx in it. Secondly we had to include the scene that it was baked in, in the build settings. Not sure if this was required before as we didn't do it but it seems obvious given it has the lighting data in it.
I am glad you found a workaround. I would still like to understand and reproduce the issue in case there is something off. Did you figure out if this was something only happening in the newest 2019.3?
Including the scene in the build would make those stripping shaders to always be included, that's what it sounds like at least.
Yes I agree, I'll working on getting two sample projects for this in both Unity Versions.
Awesome, thank you
I have now tested this on URP in 2020.3.5f1 at different scales and in different devices and I cannot seem to reproduce, also in HDRP. Closing for now
Come across an issue where we're trying to setup a lighting scene for an object at scale 100 in editor and the bake looks different in editor vs on iOS. This happens even when testing within the same scene. The lightmap scale looks incorrect on iOS.
Setup:
Unity 2019.3.3 and URP 7.2.1
Prefab with PrefabLighting script in scene at scale 100.
One Directional light
Any ideas?