Closed dimbodek closed 1 month ago
You can simply move your lightmapped textures after each bake, they don't need to be in the default folder unity puts them (which is why you are losing them I think), and that is all you need to be able to light your prefabs. So baking and moving the textures should be good for your usecase.
Beside textures unity also generates lightmapping data asset which some how also involve on shading visual and only one such asset can be applied to scene, so this is reason why i can bake separete prefabs.
Bakary do not generate such asset, i think it's just different lightning models, but unity does after each bake and such asset can be applied only to scene
The lightmap data asset is not used by this code at all, its only used by Unity "while" baking and in the settings. This script only references the lightmap textures when instantiating, etc. So simply moving them in your assets like I mentioned before should fix your issues.
unity uses lightmap data asset in play mode too, without it - shading looking another
This script (PrefabLightmapData.cs) doesn't, so I am not sure what your point is. I am going to close the thread as clearly there is not a bug or an issue and we are just discussing a point that is not relevant to the functionality of the code in this repo.
Here is the documentation so you can read about it https://docs.unity3d.com/Manual/LightmapSnapshot.html the only thing that the lightmap data asset has extra is information on probes, which are not supported in this script (although there is an alternative way we provide in LightProbeRuntime.cs to use them)
with assets and without, is shoud this plugin handle this in some way? you can see that light map asset affects on png lightmap and make it darker, in both screens same lightmap img, may be it's does gamma corection, i do not know
That looks like a real time light affecting the prefab or the scene environment lighting, etc.
yep, you are right, when remove this asset unity starts applyed mixed subtractive light(which i used for bake) like realtime directional, sorry i have't find normal docs about this lighting asset and i'am confusing what is it real does, now i see that it save information about mixed lights which was used for bake.
it's little bit distracted that when u use baked prefabs in another scene, unity applies mixed subtractive lights to them
Hi, i use one scene for bake many prefabs separete because they do not depent from each other, so for saving time i bake each separete in same scene. So after each bake Lightmapper generate LightingData for last bake, and i've seen that without this date other prefabs not showing correct.