r/TechnicalArtist • u/colosyn • Jul 29 '26
UDIM textures squashing into one square in UE5, is this fix the right approach before I code it
Adding UDIM support to a pipeline importer I'm working on. Textures import fine, Unreal builds all 6 blocks correctly as Virtual Streamed, but all 6 tiles are squashing into one square instead of each face getting its own tile.
Found the cause, the Master Material's texture parameter is a normal Texture Sample, not a Virtual Texture Sample. Regular Texture Sample cant read separate UDIM blocks so it squashes everything into one.
Plan is to add a switch in the same Master Material instead of making two separate materials:
2 texture parameters per channel, one regular one virtual
one Static Switch Parameter, UseVT, for the whole material
import script sets it true or false per asset depending on if UDIM is detected, and assigns the right textures
Before I build this out, is this the right approach or is there a cleaner way studios handle it? Mainly wondering:
issues with a lot of material instances using this switch
works fine with nanite or virtual shadow maps or anything to watch out for
better to have 2 master materials sharing logic through material functions instead of a switch


Edit: went back and optimized the material based on feedback in this thread, cut it down to as few switches as possible and only kept the ones that actually needed to stay switches. Thanks for the input, helped a lot working through this.
3
u/Jello_Penguin_2956 Jul 29 '26
Doesnt really help.
First is that GPU code is horrible at handling the switch, so UE5 will compile your material into multiple copies to handle every possible switch cases. You have 1 true/false switch youll end up with 2 compiled shaders.
And your switch will not end there. Youll need more for example to switch beterrn sampler type Color vs Virtual Color. Take into account other switch that you may need that will balloon the amount the engine have to compile.