Looking at a build report, I see that FBX models make up the largest assets in my build. What I find very confusing is that the relative sizes of the FBX models are so different from each other in my build, despite all of the character being generated by the same workflow, and being generally very similar in content and composition.
For example, here is the build log output I’m getting, which shows a range from 12.9 MB for the smallest FBX, to 82.8 MB for the largest:
The thing is, the models are all created using Character Creator, with the same profiles and export process. They have roughly similar numbers of blend shapes and vertices, and I’ve configured the FBX files the same way for all of them. Here’s a breakdown of blend shape and vert counts for these models:
Alviston Total Blend Shapes: 604; Total Verts: 73795;
Alviston_LowQuality Total Blend Shapes: 467; Total Verts: 45169;
FlynnPreRecorded Total Blend Shapes: 508; Total Verts: 39557;
FlynnPreRecorded_LowQuality Total Blend Shapes: 371; Total Verts: 28370;
Hannah Total Blend Shapes: 528; Total Verts: 49657;
Hannah_LowQuality Total Blend Shapes: 391; Total Verts: 48821;
HannahRelaxed Total Blend Shapes: 528; Total Verts: 48049;
HannahRelaxed_LowQuality Total Blend Shapes: 528; Total Verts: 48049;
So, I guess I’m wondering if anyone can give me a sense of what would cause these models all to show up in the build with such dramatically different sizes? Is there something “wrong” with the large FBX files in my build? How can I figure out what’s contributing to the size of the models?
Build report logs show uncompressed sizes, so those should match or be in the same ballpark as the .fbx file size. Which doesn’t tell how much space they actually occupy in the build, as they may get optimized/compressed.
Curious that the “low quality” is the biggest one.
Note that the FBX is more than just a mesh. It can also contains textures, and characters in your tool may use wildly different meshes, textures, and other data that goes into the FBX. If it’s an AI tool generating these, there’s no guarantee it will always generate the same thing exactly and only change the skin for instance.
All of the FBX are roughly the same size. Some are a bit more complicated, as they have different outputs. But they’ll all models I made in CC4, and exported in the exact same way. They all have 100% identical blend shapes between them, and fairly similar vert counts. So that’s why I was kind of hoping there was some way to shed light on what’s in those generated FBX files.
The file sizes it lists in the build report are all significantly higher than the raw sizes of the FBX files actually in my project. I get that blend shapes will inflate that, but it’s weird that some model would be more affected than others, since they all have identical blend shapes. So I was hoping to find our what else might be getting included to explain the big difference in sizes in the build.
I don’t know how blend shapes work technically, just used them programmatically. If they require additional vertices to function, perhaps the compression of closeby-vertices into a single vertex causes the variation. The Importer and/or Player settings have something to that effect, where very small position differences of vertices are ignored, causing them to be welded together.
Would also be interesting to make a blank project, build that for the baseline. Then add individual FBX to that project and in the scene and build. Make sure only one is in that project at any time. Then you can check whether that build report size corresponds to the same increase in build size (specifically the build’s asset files).
I did some testing in a clean project, with a clean export of my FBX from Character Creator, just to try to pinpoint what’s going on.
The raw FBX file (without embedded textures) is about 12 MB on disk, within the Unity project.
The Build Report shows this models taking up 127 MB in the build. So, about a 10x size increase over the version on disk.
However, if set the FBX not to import Blend Shapes, the size drops to 1.5 MB in the build.
I know that blend shapes contribute something to the size, but yikes. That’s a 100X increase in FBX size in the build by toggling blend shapes on/off.
Nothing else I did to the model seemed to have any meaningful impact at all over its size in the build, other than blend shapes.
So, I’m pretty much willing to set this topic aside now, with the conclusion that almost the entire reason for the large size of the FBX in a build is due to blend shapes. It seems pretty crazy that blend shapes have such an enormous impact on the size.
That warrants closer inspection though. I’ve worked on a project where we used blendshapes extensively, though I can’t say what this did to the size of the build. But I think we would have noticed a 100x increase. There was some time spent researching and setting things up where I wasn’t involved, so I’m guessing there’s more than one way to make this work.
For instance there’s a possibility that the blendshapes aren’t actually “blending keyframes” but rather Unity Importer may be expanding these to every imaginable state as separate mesh data. Or the kind of setup that causes a combinatory explosion ie if parts of the hierarchy blends but children also blend separately and so forth.
In our use case it was used to make certain objects scale in length and width according to interactive settings for lengths/widths of the train cars. Certain meshes were required to scale non-linearly.