Texture Arrays vs Texture Atlases

preview_player
Показать описание
Wondering how to implement a texture array in Unity? Want to know how they differ from Texture Atlases? Then this video is for you. A quick explanation of the differences with some hands on c# and shader code to get your own texture atlas up and running in Unity
Рекомендации по теме
Комментарии
Автор

So excited to watch. Have always been confused about this topic.

purplewine
Автор

I have never seen such a mindblowing tutorial. I am forever grateful.

aliengarden
Автор

Its great you showed how to use texture arrays in Unity, but you didn't clearly explain why someone would even choose to use texture arrays over atlases. I've worked with texture arrays in opengl/opentk only (not Unity) the biggest benefit I found was avoiding texture bleeding issues in atlases due to floating point / pixel rounding issues, so no need for any padding etc. No need for any atlas generation step every time an image changes, the array can be loaded straight from each image. Also repeating a 'sub image' texture was much simpler using arrays. Not much difference in performance in my experience, although that depends on your gpu and size of atlas/array etc. Drawbacks of texture arrays are that every 'sub image' must be the same size and this size use power of two dimensions (last time I used them at least).

Ash_
Автор

This is some great information. I'm working with OpenGL instead of unity but this was still quite helpful. Thank you

BradenHolmes
Автор

Awesome, very useful to be able to use texture arrays! Thank you

codem
Автор

Could you point to the case advantages?

MassimoRough
Автор

Thank you very much! just exactly what i needed!

nivalius
Автор

This seems like an awesome feature to mix with a triplanar shader, or even a terrain shader! Does this tile seamlessly? When the W index is changed, does that change the material so that it counts as a second material for the purposes of draw calls, or does it count as a new material, hence requiring an additional draw call? Just bought a bunch of Penny's tutorials on Udemy and if they're of this standard, I'm even more excited to get started!

ogmadigital
Автор

Amazing! I have a question though: what if I want to use roughness, normals, metallic, etc. Is it possible to add them in the shader script and select different indexes for diffuse and roughness as an example?
Thanks,

MantoDev
Автор

I am using UV2 to calculate the tile index in the shader. Thus, when scanning, I simply scatter the UV islands into the desired squares on the UV2 channel, and scale them on the V1 channel to take advantage of the tiling capabilities of each individual texture. Thus, I get 64 tile materials of 512X512 in one 4K texture. This allows me to have many models of quite high quality with one material. Unfortunately, very little is said about this technique and I "invented" it myself, which took a lot of time. In addition, I tried to create such materials in black and white and multiplied them by vertex color, which gives additional variety.

НеизвестныйЯ-гь
Автор

so, if I have several cubes with different UV values, does it batch all together or each cube will generate its own drawcall?

loop
Автор

Is it creating a new material instance with each object or is it still a shared material?
Because performance of texture array depends on it.

kadiryumlu
Автор

thank you for this, always so helpful.

rocksfire
Автор

Great tutorial. I'm looking for more efficient ways of creating textures for multiple assets to use and this seems alright. I still don't know if it's more beneficial over the standard atlas though

MonsterJuiced
Автор

Which one is more performant? - Texture Arrays or Texture Atlases???

PRodi_
Автор

this does not work for prefab, the mesh filter store mesh instance and the mesh gone missing after Instantiate

hata
Автор

Why you didn't use shader graph ???

HammaGaming
Автор

That just doesn't make sense if we want to increase number of tiling U and V values in order to achive higher resolution seamles texture... For this purpose i would use traditional Texture Atlas.

karolledzinski