Hello ev!
How can I set, which texture to apply from a texture2darray? Should I use “txt” pin? And also, some recommendation about txt2darray?
Thank y’all so much!
Hello ev!
How can I set, which texture to apply from a texture2darray? Should I use “txt” pin? And also, some recommendation about txt2darray?
Thank y’all so much!
You append a 3rd-value (B/Z) to the 2value UVs (RG/XY). This value in the third-slot tells Unreal which layer to pick, starts at 0.
If you need a set-of-textures, you can also look into UDIMs with unreal. This makes a single addressable page/table, rows and columns of all your textures laid out, and you pick by adding the row/col value to the UVs. So in a 3x3 page, I pick the one on the lower right by using UVs 2-3 for X and 0-1 for Y (first row).
This matters b/c TexArrays do not currently support virtual textures:
Ehi mate! Thank you for answering! So the third value goes within uv coord (v2) in the “uv” pin of txt2darray, not in the “txt” pin, right? I know about UDIM’s method but I’m not so confident with it rn. I mean about the best res to render each square.
I made a unique master material to instance, with 3 functions. One f is to manage txt mapping/tiling, the second f is to manage the scattering/mipmap and the third f is where I need the texture2darray. for each txt map.
Can you confirme? @Frenetic
Like this:
There are 5 textures in my Array 0, 1, 2, 3, 4. The green layer (grass) is 2nd from the bottom so it’s layer 3.
Changing the layer ID to 4 makes it snow (white):
I was in doubt about the “tex” pin. Anyway, thank you so much man! Some tips about txt2darray?
As I understand it, Texture Arrays are loaded entirely into memory, so if you make a stack of things, you will need to ‘carry’ it around.
UDIMs support virtual-textures which can be streamed in as the app requires it. Lesser memory overhead holding textures, and you can also get away with higher resolutions since you are streaming in only the necessary parts. Since UDIMs are an addressing-trick, your textures don’t have to share the same size, you can UDIM 1024x1024 along with 4096x4096.
Functionally, in your material, they work the same, as any other texture-sample. It’s on the backend/overhead that you have to worry about resources.
My experiments show that using UDIMs gives better performance, but not a large amount. Enough, however, to move me away from Texture Arrays to UDIMs.
Do you mean using texture atlas insted of txt2darray? Anyway, it’s really intersting. I’m not expert about this ue topic but probably I’ll try to achieve the same result making atlas. I’m just worried because as I said before, I’m not so confident with multiple txt inside the same square. Are you sure this method is used for big props with high res also? for example… Or is it better to use with small ones?
Yes. UDIMs basically create a texture atlas that you can then address specific ‘squares’ (textures).
So each render can be different and indipendent from each other in therms of resolution? How do you approch it?
When I swapped from TexArrays to UDIM, none of my materials changed except for some slight logic in where I generate my UVs. Instead of appending a layer ID, I can pick out the cell in the UDIM and add to the X and/or Y appropriately.
Otherwise the rest of the material logics will be the same, there is no special accounting with where the texture comes from, it’s still just a texture.
As for the render, yes, each texture can have it’s own dimensions, so you can mix different things there if it avails you (with UDIMs).
Good morning mate, I’ll try to make one. I hope texture will not “blur” in a big asset for example. Anyway you’re really gentle, thank you so much!
This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.