Author Topic: SBSAR build size  (Read 1093 times)

Is there anything that can be done within Unity to reduce the build size of SBSAR files? I've started using crunch compression for my textures, which leaves pretty much all my SBSARs as the big contributors to build size. None of the settings I tried changing in the Unity Inspector for the SBSAR had any impact on the build size.

If there isn't a way to dramatically reduce these sizes, I'll most likely abandon using SBSARs within Unity itself, and just export textures from substance designer.

Here's an example from my build log. Thanks:

Code: [Select]
Used Assets and files from the Resources folder, sorted by uncompressed size:
 85.3 mb 5.5% Assets/Materials/Substance/Gravia/Decals/Dirt/BasicDirtGenerator.sbsar
 42.7 mb 2.7% Assets/Materials/Substance/Gravia/Areas/EnergyResearch/EnergyResearchStripedWall.sbsar
 26.7 mb 1.7% Assets/Materials/Substance/Gravia/Decals/PreRiftFizzleMark/PreRiftFizzleMark.sbsar
 26.7 mb 1.7% Assets/Materials/Substance/Gravia/Decals/Explosions/ExplosionDirt/ExplosionDirt01.sbsar
 26.7 mb 1.7% Assets/Materials/Substance/3rdParty/concrete_011.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/metal_grill_triangle_scales.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/Gravia/Areas/P&L/Warehouse/PLWarehouseWallTransition.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/paint_matte.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/Gravia/Areas/P&L/Warehouse/PLWarehouseUpperWall.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/Gravia/Areas/P&L/Warehouse/PLWarehouseLowerWall.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/rusted_painted_metal.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/paint_satin.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/paint_glossy.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/concrete_scratch.sbsar
Last Edit: July 27, 2018, 09:31:24 pm

Is there anything that can be done within Unity to reduce the build size of SBSAR files? I've started using crunch compression for my textures, which leaves pretty much all my SBSARs as the big contributors to build size. None of the settings I tried changing in the Unity Inspector for the SBSAR had any impact on the build size.

If there isn't a way to dramatically reduce these sizes, I'll most likely abandon using SBSARs within Unity itself, and just export textures from substance designer.

Here's an example from my build log. Thanks:

Code: [Select]
Used Assets and files from the Resources folder, sorted by uncompressed size:
 85.3 mb 5.5% Assets/Materials/Substance/Gravia/Decals/Dirt/BasicDirtGenerator.sbsar
 42.7 mb 2.7% Assets/Materials/Substance/Gravia/Areas/EnergyResearch/EnergyResearchStripedWall.sbsar
 26.7 mb 1.7% Assets/Materials/Substance/Gravia/Decals/PreRiftFizzleMark/PreRiftFizzleMark.sbsar
 26.7 mb 1.7% Assets/Materials/Substance/Gravia/Decals/Explosions/ExplosionDirt/ExplosionDirt01.sbsar
 26.7 mb 1.7% Assets/Materials/Substance/3rdParty/concrete_011.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/metal_grill_triangle_scales.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/Gravia/Areas/P&L/Warehouse/PLWarehouseWallTransition.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/paint_matte.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/Gravia/Areas/P&L/Warehouse/PLWarehouseUpperWall.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/Gravia/Areas/P&L/Warehouse/PLWarehouseLowerWall.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/rusted_painted_metal.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/paint_satin.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/paint_glossy.sbsar
 21.3 mb 1.4% Assets/Materials/Substance/3rdParty/concrete_scratch.sbsar

Hi,

Do you have embedded bitmaps in the sbsar files? Fully procedural sbsar files should be only a few kb in size. This is where the real benefit is from using sbsar. The build size is extremely low and textures are only generated at runtime where they are then held in vram like any other texture. However, you need to be working fully procedural to get these size savings.

The way to reduce the file size would be to remove any embedded textures. However, if you need to have some textures embedded, you can change the compression in Designer. When you import a bitmap into Designer, the compression is set to RAW. Change this to Jpeg and it will drastically reduce the size of the sbsar. You can do this in the properties for the texture in Designer.

If I need to use textures in my Substance, I will change the compression and also try to use the lowest resolution I can. Often times you can use a lower res like 1024 and with procedural effects on top, you don't notice.

Cheers,
Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Thanks. As far as I know, all (or most) of the SBSARs are procedural, and take up very little space on disk. For example, my "EnergyResearchStripedWall.sbsar" is only 5KB on the disk, but is 42.7 MB in my build.

The "paint_matte.sbsar" substance is 3KB on disk, and 21 MB in my build. This is an SBSAR I got from Substance Source, so I don't have control over its settings, but it doesn't appear to be using an underlying bitmap.

Is there possibly a build option I've accidentally enabled that pre-generated SBSAR output textures as includes them in the build, rather than waiting to generate the textures at runtime?

Thanks. As far as I know, all (or most) of the SBSARs are procedural, and take up very little space on disk. For example, my "EnergyResearchStripedWall.sbsar" is only 5KB on the disk, but is 42.7 MB in my build.

The "paint_matte.sbsar" substance is 3KB on disk, and 21 MB in my build. This is an SBSAR I got from Substance Source, so I don't have control over its settings, but it doesn't appear to be using an underlying bitmap.

Is there possibly a build option I've accidentally enabled that pre-generated SBSAR output textures as includes them in the build, rather than waiting to generate the textures at runtime?

Thanks much for this information. We don't have the build behaviors implemented yet. With further investigation, it looks like the textures that get generated are baked into the assets file. So if your 5K sbsar makes 5 2k x 2k uncompressed textures it becomes very large. At this time in the beta our most common use case is to view and change substances in editor, but bake outputs for players. We will have this resolved in a future update where the proper loading behaviors are implemented and textures are not baked if the user chooses this option.

Cheers,
Wes
Head of Substance Demo Art Team
the3dninja@adobe.com
Twitter: The3DNinja

Thanks for the update. Perhaps the biggest issue with the current state of things is that these textures don't do any kind of compression. I generally have Crunch compression enabled on the one-off textures I generate from Substance Painter, but I can't do the same thing with my SBSARs.

For now I'll hold off on any dramatic changes to my workflow, in hopes that this will be addressed in the next few months. Otherwise it's probably a dealbreaker for using the plugin. (I think that 80% of my build size is SBSARs right now).