Optimizing build size & time

Modified on Tue, 16 Nov 2021 at 07:19 PM

Voxel Play comes with many demo resources and shaders that can be removed to improve build time and reduce app size. Please note that shaders can take some time to get compiled but only during the first build. Unity caches the compiled shader variants in the Library folder so next time they need to be compiled, it will go a lot faster.


Unless you're using some of these resources in your own game, you can remove them safely as Voxel Play engine doesn't need them:


1. Remove all the demos and their associated resources:


- Delete "Demos" folder

- Delete "Voxel Play/Resources/Worlds/Colorizer" folder.

- Delete "Voxel Play/Resources/Worlds/Earth" folder.

- Delete "Voxel Play/Resources/Worlds/EarthTestCompute" folder.

- Delete "Voxel Play/Resources/Worlds/HQForest" folder.



2. Remove the sample character:


- Delete "Voxel Play/ThirdParty" folder.



3. Remove unused default textures:


- Delete "Voxel Play/Defaults/Shore" folder if you're not using these voxel definitions or shore textures in your terrain generator or biomes.

- Delete "Voxel Play/Defaults/Water/water*" textures if you're using your own water textures.




3. Remove unused shaders:


- Delete "Voxel Play/Resources/Shaders/VPCurved*" files if you're not using the curved world feature and these shaders on your objects.

- Delete "Voxel Play/Resources/Shaders/VPIndirect*" files if you're not using compute buffers option in Voxel Play Environment inspector.

- Delete "Voxel Play/Resources/Shaders/VPSkybox*" files if you're using your own custom skybox.

- Delete "Voxel Play/Resources/Shaders/VPVoxelTriangleOpaqueWorldSpaceUV*" files if you are not overriding the default opaque render type of any voxel definition using the world space UV replacement shaders.

 - Delete "Voxel Play/Resources/Shaders/VPVoxelTriangleOpaqueAnimated" shader if you're not using animated voxel definitions.

- Delete "Voxel Play/Resources/Shaders/VPVoxelTriangleCloud" if you're not using the voxel clouds included with Voxel Play.



4. Remove unused shader features:


- Remove the #pragma multi_compile _ VOXELPLAY_USE_OUTLINE line from all shaders in "Voxel Play/Resources/Shaders" folder if you're not using the outline option in Voxel Play Environment (in Visual Studio, execute a search for the keyword VOXELPLAY_USE_OUTLINE and remove all those lines starting with #pragma multi_compile ... which contains the keyword).

- Remove the "VOXELPLAY_USE_PARALLAX" keyword from all shaders in "Voxel Play/Resources/Shaders" folder if you're not using the relief mapping option in Voxel Play Environment (in Visual Studio, execute a search for the keyword VOXELPLAY_USE_PARALLAX and remove just that keyword (not the entire line in this case) from the lines that start with #pragma multi_compile ...).



5. Set Managed Stripping Level


- In Project Settings/Player, scroll down to the bottom and set the "Managed Stripping Level" to "Low" or higher value.



Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select atleast one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article