Texture Atlas Border/Padding Size
Most malevolent Doomsday Mastermind,
In the Optimization Tips section, on the 3D Model Assets page of the manual, it reads:
I’m looking for the exact borders and other padding the engine needs for my model textures to be optimized. The “a bit smaller” wording is unsatisfactory to my inferior robotic mind.
My current quandaries:
In the Optimization Tips section, on the 3D Model Assets page of the manual, it reads:
All textures used by a model are stored in a large atlas. This means there are no restrictions on texture sizes, i.e., they do not have to be powers of two (e.g., 1024×1024). However, because the atlas needs borders and other padding around the textures stored in it, it is recommended that the model's textures are a bit smaller than power-of-two sizes. For instance, four 1000×1000 textures will easily fit on an atlas of 2048×2048; however, only one 1024×1024 texture would fit.
I’m looking for the exact borders and other padding the engine needs for my model textures to be optimized. The “a bit smaller” wording is unsatisfactory to my inferior robotic mind.
My current quandaries:
- Would a single pixel difference work, where four textures at 1023x1023 px would fit into a 2048x2048 atlas?
- Or, is a single pixel border for all four edges required, where four textures at 1022x1022 px would fit into a 2048x2048 atlas?
- Or, is there some other specifications hidden inside “borders and other padding” I should consider when optimizing/maximizing my pixel budget?
Comments
For example, in the new 3.0 renderer I'm using a padding of 16 pixels that allows using mipmap levels 0-4 without major artifacts at borders.
When it comes to model rendering there is a slight issue, though: the model shaders don't do any mipmapping at the moment, and consequently the automatic atlas builder uses a padding size of 1.
The atlases are allocated as 8192 x 8192.
I'm thinking that to enable mipmapping in models we'll need to use 8 pixel padding so mipmap levels 0-3 are available. (Level 3 is 1/8th of the original size.) My atlas allocator seems to apply the padding on all sides of allocated images, so assuming equal-sized images:
Are the mentioned artifacts at borders due to compression, resampling, or something like that? My model UVs/textures have some padding and currently have a base size of 2048x2048 so I don't foresee any problems but I'd like to be sure.
I'm sure it can help us improve the dhmp
If you are referring to when I mentioned my current UV/texure sizes, those don’t have mipmapping yet. I was simply stating the current texture sizes to help illustrate that artifacting at the lower mipmapping levels shouldn’t be much of a concern for myself, partly because of the padding I built into the model UV maps.
If you’d like, I could create a mipmapped version of my textures so you could see how that would effect artifacts from downsampling. At different levels/distances. That could be helpful since presently it isn’t something we can test in DE2.