-
-
|
|
Re: Problem: XNB files grooowww hugely
|
Unfortunately that growth is the nature of the XNB file. It's a quickly read binary file, so it will not be as small as most file sizes. You can take a look at EasyZip (see link in my signature) which lets you have your project automatically place all the built content into a compressed ZIP file. It comes with a ZipContentManager that lets you stream the files out so you don't even have to unzip the package on the Xbox. I heard there are some bugs on Xbox, but that was just one or two and I haven't heard anything lately, but give it a try and see. It is open source, so you can also poke around and see if any bugs are easily fixable if they come up.
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
|
This is really (really) weird.
I have seen the exact oposite. As an example, I build a model and heavily smoothed it in Max, near to 200.000 vertices to do some test using nprof, and when the standard processor converts the x file (about 29 Mb in size without animations, and 30 Mb in size with constraints and 12 meshes animated) it ends with just 2 Mb!
Also, my tga files consistently decrease in size about 70 to 80%.
I will love to hear why are some files increasing and why others decrease (and decrease radically) in size.
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
|
Depends on the source data and the processor. For instance a PNG is a very compressed file. So if you build it to XNB with mipmaps you'll see massive size increases. As for you getting smaller files, that's new to me. I've never seen a file get smaller.
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
|
Well, to be strict, my tga files where uncompressed before processed by XNA, so maybe an aparent decrease in size is just because the way and format XNA ends with (with the xnb extension). I have a feel is something very similar to a .dds compresed file. But the .x file is a text file and it really decreased (as I said from 29 Mb to near 2 Mb).
Edit: I checked the .x file and it is 68.736 vertices. Decreased from 30.577 KB to 1.982 KB.
Anyways, I think the texture files size may increase if they where compresed before processed. As I said, I'll love to know why is this.
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
|
If you have an text file version of the X model, it will most likely shrink in size since the XNB is a binary format. Binary formats are almost always smaller than text equivalents. So that might explain why you see a gain there. Plus the XNB only stores the data that the processor deems relevant so any extra information or tags or other things like that won't end up in the final file. This can also result in a large cut-down of filesize.
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
|
Nick Gravelyn:As for you getting smaller files, that's new to me. I've never seen a file get smaller.
If you convert a compressed format like .png or .jpg into uncompressed Color format, the data will get bigger. If you convert an uncompressed format like .tga into compressed DXT format, the data will get smaller. If you care about texture sizes, you should make sure your processor properties are set to use DXT compression.
XNA Framework Developer -
blog - homepage
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
|
Nick Gravelyn:If you have an text file version of the X model, it will most likely shrink in size since the XNB is a binary format. Binary formats are almost always smaller than text equivalents. So that might explain why you see a gain there. Plus the XNB only stores the data that the processor deems relevant so any extra information or tags or other things like that won't end up in the final file. This can also result in a large cut-down of filesize.
Yep. That makes absolute sense. I think this about model files plus what Shawn said about compresed/uncompresed files explain it all.
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
|
So, there is no solution to this problem :-( However, my last chance to try shrinking those files is using that EasyZip, if that is the only way to shrink the files, I don't have another option except this :-\ I wish with the Next GameStudio 3.0 they solve this problem with a new feature capable to reduce the size of the XNB files, I hope so. Thanks for help!
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
Answer
|
Fanboy Junior:So, there is no solution to this problem :-(
Sure there is. "If you care about texture sizes, you should make sure your processor properties are set to use DXT compression."If you want you can then use EasyZip to compress your data even further, but switching to DXT format is the easiest place to start.
XNA Framework Developer -
blog - homepage
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
|
Though remember DXT compression is lossy so may blur depending on what i in your textures and can possibly blur any alpha resulting in a non perfect alpha around edges.
The 3rd solution is not to worry about it.... disk space is cheap - are you actually running out?
The ZBuffer News and information for XNA Please read the forum FAQs - Bug reporting
|
|
-
|
|
Re: Problem: XNB files grooowww hugely
|
Shawn Hargreaves: Fanboy Junior:So, there is no solution to this problem :-(
Sure there is. "If you care about texture sizes, you should make sure your processor properties are set to use DXT compression."If
you want you can then use EasyZip to compress your data even further,
but switching to DXT format is the easiest place to start.
Nice, I will take a look at the DXT format! After you posted here I googled seeking this DXT creator and find some tools from ATI and Nvidia, well, if the result excite me, I will be glad to use that kind of file in my game :-) Thanks
|
|
-
|