Normal map compression square-shaped artifacts.

Hi,

I have problem with normals maps. When compression is OFF it looks OK, but the image (2048x2048) is 16MB which is too big.

When I turn on compression my object has weird square artifacts, see the image below, file size is 3MB.

  • I use URP

Here’s Lighning settings:

How to fix it?

Another example:

What format is the texture is showing it is? When you have the texture selected, it should show a preview of the texture of it at the bottom of the inspector window, along with the format of the texture. For a desktop project with high quality compressions settings, it should show:
“2048x2048 RGBA Compressed BC7 UNorm 5.3 MB” (or 4 MB if you have Generate Mip Maps disabled).

However I noticed you have an Android tab for the texture settings, which along with the “3 MB” size and compression artifacts you’re seeing makes me think this is a project with Android as the target platform. In that case the format is likely going to default to ETC.

The ETC texture format has terrible quality, especially for normal maps, but is the only compressed texture format universally supported on all Android devices. If you don’t need to support OpenGLES 2.0 devices, you can use ETC2 or ASTC instead. ASTC will be the highest quality, but it is not supported on all GLES 3.0 devices, though is supported by the vast majority of GLES 3.1 devices. ETC2 isn’t quite as nice, but is still a significant quality bump over ETC. If the texture format isn’t supported on the device currently running it, it’ll drop back to using an uncompressed version of the texture, though extracted from the compressed version shipped with the build. You can override what the default format is on a per texture basis, or in the Build Settings window.

If you’re wondering how save it is to move to ASTC, starting with Unity 2021.2, ASTC is the default texture format for Android projects.

Note that ASTC 4x4 and ETC2 will be roughly twice the file / memory size as ETC. You can try manually selecting ASTC 6x6 on the per-texture override tab (the Android icon in the Texture’s Import settings) which will bring it down closer to ETC in file size, but should still be significantly higher quality that ETC.

2 Likes

Thank you for reply.
Target platform is Android (VR headset). I want to support only one VR headset device.

Those are my current settings:
Max size: 2048
Resize algorithm: Mitchell
Format: Automatic
Compression: High Quality
Use Crunch Compression: Unchecked
PC Android and PC tab have no overrides.

Preview window shows: “2048x2048 RGB Compressed ETC UNorm 2.8MB”

7609834--945205--upload_2021-10-28_11-32-41.png

I’m using Unity 2021.1.7f1.

  • In Build Settings in Texture Compression there is “ASTC” option available. I selected it.
  • On each normal map texture there was “RGB(A) Compressed ASTC 6x6 block” selected by default, so I left it as it was.

Now it works great! Squares from 1st image are gone. Metal floor looks good even from close distance.

The size is bigger than ETC, but acceptable, here’s some comparison:
7609834--945250--upload_2021-10-28_12-26-4.png

To give some context, my project contains 28 normal map files, 347MB in total, 4096x4096 and 2048x2048 sizes.

Size comparison for one 2048x2048 texture:

  • Uncompressed: 16MB
  • ASTC, Low Quality: 1.3 MB
  • ASTC, Normal Quality: 2.4MB
  • ASTC, High Quality: 5.3MB

I will go for ASTC, Normal Quality.

Thank you for you help! You saved me from hours of googling. :slight_smile:
Now I will try to find best way to remove aliasing from VR device.