Home Technical Talk

Why the size of two fbx files is different?

sahibzada
polycounter lvl 10
Offline / Send Message
sahibzada polycounter lvl 10
Hello Everyone,
A guy gave me fbx file of city which was downloaded from Unity Asset Store. The size of Fbx is 20.8 MB(1728 OBJECTS) he wants to reduce the size to 12MB. I tried the following techniques:
Exporting from 3ds max  UNCHECKED everything except Smoothing groups it reduces the size to 18.1 MB. 
Iimported the fbx file in blender and re-exported it. It further reduces the size

I then categorized the 1728 objects in 3ds max, attached them in 10 different categories assigning different materials (buildings, trees, props etc)
Re-exported the file from 3ds max and it dramatically reduced the size to 8 MB. Reimported the 8 mb file in blender and exported it increased the size .
Main problem comes in Unity when he tries to disappear and appear the items he says items appear and disappear on the basis of meshes. If Building mesh comes in contact with camera complete mesh will disappear.
My question is: WHAT INCREASES THE SIZE OF SAME FBX( I DIDN'T EVEN WELD THE VERTICES) so what increases and reduces the size of FBX. Is there any way to reduce is the size of FBX without attaching the objects? 
Please help

Replies

  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter
    You are changing 5,000 variables and then trying to guess which ones do something.

    If you want a smaller file, you use less resources. Less materials, less textures, less triangles. 

    As an example, if you do not weld two verts together, then there is two verts instead of one.

    Exporting from one software or another isn't a very reliable test because by default they may not be using the same settings. 

    The guy who doesn't understand how collision works in unity probably does not have a real sense about what size specific fbx's need to be either. Most likely it is a couple of beginners working on a game project? In that case, just forget the numbers and focus on the game. If you have a fun game and performance is a problem, then it will be easy to get specific help to tidy up what you have.

  • sprunghunt
    Offline / Send Message
    sprunghunt polycounter
    Why are they making this in one big FBX file? Typically in unity you'd make everything as individual FBX files and then assemble these in the editor. If they want to selectively hide parts of the scene that's the easiest way to do it. 

    If they want small file sizes on disk they should compress the files. 
    https://answers.unity.com/questions/17870/whats-the-best-way-to-implement-file-compression.html
  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter

    Fbx can contain all sorts of stuff and alex says, each app exports different stuff (particularly blender)


    You'll get smaller files by

    exporting as binary

    Disabling features(eg animation)

    Reducing the number of layers ( eg. UV sets , vertex color sets)

    Not embedding media

    Having less objects

  • Ghogiel
    Offline / Send Message
    Ghogiel greentooth

    Open the fbx in max and check channel map info.

    Delete all the useless vertex channels unless you need them.


    Couple weeks ago had a guy have to do some modifications to the game set up on a model I made in max. He used blender, just some pivots and parenting. No clue about his fbx export settings. But the file ended up 10mb instead of 1mb.

    Thing is this guy has had his fingers into a lot of project files (doing needed work admittedly)> but potentially adding a 0 across a most of the vertex data in a project for no reason.

    Easy thing to miss imo

  • Alex_J
    Offline / Send Message
    Alex_J grand marshal polycounter


    Once a game is built - lets say either unreal or unity for example - that is compressing everything anyway, right? Would going through individual fbx files in this way, removing extraneous data, make a difference in the packaged game?


    Pure curiosity, no way in hell I'd actually go to the trouble.

  • Ghogiel
    Offline / Send Message
    Ghogiel greentooth

    Doubt compression removes all that vertex data if any, how would it know it's not used at some point in a random script or BP in the middle of the game running? It should just be a way of packing and storing the data that is there so it's smaller on disk at the expense of time it takes to unpack and load it into mem, not be deleting extra channels to make the file smaller on disk.


    At least, I would be extremely annoyed if compression removed all the extra floats that I might have attached to vertices, like maybe I want a full set of vertex color? Maybe I need 4 UV channels.

  • poopipe
    Offline / Send Message
    poopipe grand marshal polycounter

    I'm not very familiar with Unity but it wasn't developed by idiots so you can be confident that the compiled content of a model is determined by settings in the engine, not what you export from your DCC.

    The disk size of the fbx file is unrelated to both runtime performance and disk size of your game because you do not ship the fbx


    so..

    @Alex_J

    yes

    No compiler is 100% efficient so maybe you could find edge cases, but no

    I wouldn't either - better to work on the compiler / in engine settings

  • Mink
    Offline / Send Message
    Mink polycounter lvl 6
Sign In or Register to comment.