[Unity3d] about U3D map format compression

Source: Internet
Author: User

Http://blog.sina.com.cn/s/blog_5b6cb9500102vi6i.html

Because a lot of people have asked me the problem of compression format, today, Brother Fei again reminded again. Tidy up and send a post for everyone to consult and discuss.

Various texture formats, we refer to the following U3D manual inside the specific description of the introduction, this is the official thing. But I think one of the contents is wrong, such as taking up memory size.

Http://docs.unity3d.com/Manual/class-TextureImporter.html

Basic Points of knowledge:

DXT format is provided by Nvidia Tegra, etc is supported by Android native, OPNEGL2.0 are supported. ETC2 only OPENGL3.0 support, PVRTC is provided by Imagination PowerVR, ATC is Qualcomm Snapdragon provided. In general, iOS only supports PVRTC compression formats. Once the corresponding map format is incompatible, U3D automatically converts it to the RGB (A) format. The best compatibility is for the GPU to be packaged, such as the use of the ATC format for Xiaomi, but the general development does not make the choice too thin. All devices are well supported for RGB 16bits/argb 16bits/rgb a16bits/rgb 24bits/argb 32BITS, except that these formats are non-compressed and very unfriendly to memory consumption and rendering consumption.

About the size of the compressed storage , assuming that the HD (ARGB32) size is 1, then the approximate data is as follows:

RGB PVRTC 4bits:0.25

ARGB PVRTC 4bits:0.25

RGB PVRTC 2bits:0.13

ARGB PVRTC 2bits:0.13

RGBA ETC2 4bits:0.25

RGBA ETC2 8bits:0.25

RGB + 1-bit ALPHA ETC2 8bits:0.2

dxt1:0.3

dxt5:0.6

ARGB 16bits:0.33

RGB 16bits:0.5

RGB 24bits:0.85

ARGB 32bits:1

Of course each is based on the picture is different, but the above is only the approximate data is not accurate data.

Test method: Separately for the file to be changed to such a map format assetbundle look size.

There is a big doubt about this is ARGB 16 and RGB 16, the feeling may be here u3d bundle has a bug.

The size in memory , assuming that the HD (ARGB32) size is 1, then the approximate data is as follows:

RGB PVRTC 2bits:0.0625

ARGB PVRTC 2bits:0.0625

RGB PVRTC 4bits:0.125

ARGB PVRTC 4bits:0.125

RGBA ETC2 4bits:0.125

RGBA ETC2 8bits:0.25

RGB + 1-bit ALPHA ETC2 8bits:0.125

dxt1:0.125

dxt5:0.25

ARGB 16bits:0.5

RGB 16bits:0.5

RGB 24bits:0.8

ARGB 32bits:1

?

The recommendations are as follows:

Generally 3D games we compress maps into UI maps and scene model maps, mainly because of multiple sampling. 3D games are generally subject to different sample sizes depending on the size of the camera, assuming that multiple texture sampling is not set, and there is a lot of white noise in the distance.

In the game, all do not need to check the multi-sampling, with 3D nature of the map, we need to tick the Generate MIP MAPS, which will increase the size of the map 25% this way.

Square and non-square maps are also distinguished. Non-square maps are only 16-bit compressed (equivalent to half the true color), so the best game is a square map. The following is a personal choice map compression format to follow some of the rules, you can refer to, if there are problems can be exchanged together.

Square Map:

Under iOS:

A. Normal opacity: RGB PVRTC 4BITS

B. General transparency: RGBA PVRTC 4BITS

Under Android:

A. Ordinary opacity: RGB ETC 4BITS

B. General transparency:

Because there is no universal most compatible format, the general situation is to use RGBA 16BIT or a targeted selection of Dxt5/atc8 bits/etc2 8BITS. If you have technical support, you can use RGB ETC 4BITS plus an Alpha 8 map to achieve transparency.

Non-square Mapping:

Generally use 16-bit compression, 16 will bring color loss, but if the original art is according to 16BITS painting, there will be no loss, Japan is a lot of hand travel by 16BITS to draw. This kind of game generally less gradient of high-gloss is more easy to see out.

A. Opacity map: RGB 16BITS

D. Transparent map: RGBA 16BITS

HD Uncompressed Stickers:

RGBA 32BIT

Other than that:

For non-important maps, low-blur maps, it is recommended not only to take pixel compression, but also to compress its size directly. If the illumination map is pressed to 512 or 256. If the background of the original 1024 of the figure is pressed directly to 256. The player will not notice it.

[Unity3d] about U3D map format compression

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.