- Home /
How to reduce Lighting Data asset size?
Hi, we got a problem using Unity GI system.
After baking lighting data we got a huge size of resulting build. It is almost 300 mb for one small level.
According to this topic it contains all the data to generate lightmaps at runtime: http://forum.unity3d.com/threads/is-lightmapsnapshot-asset-in-unity-5-the-same-as-unity-4s-lightprobes-asset.279969/
But we don't need this functionality. We created 5.7 mb 2048x2048 lightmap and it is enough for our purposes.
How to tell unity not to put all this data to the final build?
Answer by Carling_Technologies · Aug 16, 2016 at 06:00 PM
@Dufrenite Find the asset and delete it, that's what I did for my game after figuring out what took so much data. After deleting it I found it did absolutely nothing different to the scene. Maybe export a backup of it before deleting though. - it saved me over 280mb for a small scene.
Answer by 13245768 · Sep 25, 2016 at 09:02 PM
I'll tell you the correct answer!
Cancel Lighting> Precomputed Realtime GI 2.Build LightingMap
My LightingData.asset From 91.8 MB to 657 KB
Answer by Remster · Jan 16, 2017 at 07:45 AM
Be advised that this LightingData.asset file also contains calculated Light Probe values: Deleting it will disable all light probes. Each lightprobe seems to take quite a bit of space: I tried to evaluate and I would like it if Unity could answer this: My scene has 1496 light probes. The resulting files inside the APK (built for Android) are: bin/Data/GI/level1/ce/ce2a73e858292abd7fd7f7296861e77b.pos = 23940 bytes bin/Data/GI/level1/ce/ce2a73e858292abd7fd7f7296861e77b.rpc.neo = 1535000 bytes
I'm assuming the 'pos' file is the x,y,z coordinate of all probes, which should take 12 bytes per probe. By looking at the file size, apparently it takes 4 bytes per probe + a 4 byte header. There is an unknown 4 bytes per probe stored here. What is it?
Regarding the data itself (.rpc.neo), it seems to be taking approximately 1026 bytes of data per probe, which is gigantic. From what I understand according to the documentation, it should require only 27 coefficients, so 108 bytes per probe. Can Unity explain what else is being stored in here? Note: Precomputed realtimeGI is disabled, and I am on Unity 5.5.0p2