Texture Atlas Compression

Hi everyone,

before I start writing a probably (for me at least) rather difficult script, I wanted to ask for any approach ideas.
I am using the TextureAtlas Plugin to bake the textures of my city into Atlasses. But because many textures of the buildings faces are actually the same, most of the atlas pixels are actually repeating patterns (see attached atlas image

). So I thought, in order to reduce the file size of the atlas image, would make sense, to compare pixel areas, and if duplicates are found, to change the texture coordinates of that face to the same area of the texture atlas, and die the repeated pixels black.

This way, the texture atlas would be reduced in size, since large areas would be black and with JPEG compression this should affect the size significantly.

Of course, an even better approach would be, to unwrap the faces, so that repeated textures have the same texture coordinates from the beginning, but there seems to be no automated way to do so, and since I have more than 10.000 Buildings, there’s no way to manually unwrap each one of them.

Maybe some of you know that problem and have already tried themselves? Any Help or suggestions or hints are much appreciated!


are the buildings duplicates, or just the textures? If there are duplicated buildings, you could just use the texture atlas on one of each of the duplicates.

no, the buildings are unique in shape, its just the textures that are duplicate …

Hmm, that is a tough one. I feel like you should be able to lookup the UV coords and compare them face to face to find matching UV segments, but it would be a moderately difficult script to program. All the information is there, It’ll just take some cleverness to get it going. Good luck!