Search Unity

Exclude unused LOD meshes for specific platform

Discussion in 'Addressables' started by noxxomatik, Jan 28, 2019.

  1. noxxomatik

    noxxomatik

    Joined:
    May 9, 2018
    Posts:
    10
    In my current multiplatform project I use several game objects with LOD groups. To improve performance on mobile devices I exclude LOD level 0 in the quality settings. When I build a normal .apk file without addressables, I can see that the index 0 mesh is automatically excluded since the file size of the build is much smaller then a build with LOD level 0 included.

    Now I want to integrate the addressables system to download some remote game objects at runtime, but I can't find a way to exclude LOD levels from the player content build. All meshes are exported and increase the download size with unused content.

    Does anybody know a way to exclude mesh renderers from unused LOD groups without exchanging the whole game objects? When I added the mesh to an asset group which is excluded from build, the mesh seems to be added to the asset bundle of the parent game object.
     
    eastepp likes this.
  2. JasperCiti

    JasperCiti

    Joined:
    Jul 5, 2013
    Posts:
    17
    Have you found a solution for your problem yet?
     
  3. emrys90

    emrys90

    Joined:
    Oct 14, 2013
    Posts:
    755
    I'm having the same issue with asset bundles including LOD level 0 in an Android build. Has anyone found a solution?
     
  4. kenamis

    kenamis

    Joined:
    Feb 5, 2015
    Posts:
    387
    I accomplished this exact requirement using Addressable variants. In the main project, the prefabs are set up using all the LODs, including 0. Then, when building for android, I have a custom build script that detects the addressable assets with LODGroup, duplicates the original asset, removes the original entry and adds the new asset with the original entry's name and finally removes LOD0. Then when the build is complete, it reverts the addressable entries and removes the temporary variant asset.

    There is an example of Addressable variants in the Addressable sample project.