DirectX11 with UDIMS

Hi,
i was wondering if a DX11 shader can read UDIM files?

the UDIM-i-ness comes from the convention that knows how to map one of several related textures to the correct subset of faces in a model,

UDIM is usually implemented at the engine or renderer level – by the time you are inside the shader proper, just going to be a regular texture reference and some shader code that just keeps the fractional part of the UVs. So your shader, properly speaking, might not even know it was a UDIM shader – it’d be the code that sent the shader, model part, and texture references to the GPU that handles the UDIM part.

You can implement a simple, not-very-flexible version of UDIM in a shader by checking the integer part of the UV coord to switch between textures – so if I were going to have two UDIM blocks, i’d pass two textures to my shader and switch between them based on whether the floor(uv.u) is 0 or 1. and so on.

It’s not that complex in theory, though once you do more than a few tiles the shader is gonna get more and more cumbersome. Generally you don’t want to do this for general use at this level, since hlsl code is not a great place to try to be making decisions based on, say, file names. For up to maybe 4 UDIM tiles It’s doable --beyond that you might want to grab an engineer to give you a hand. As you can see from this video, the heart of the system is really just about handling some file name conventions

Thank you for your explanation,
what i did is that i imported the first texture in a file node and select the UDIM option in UV Tilling Mode.(i have 3 Tiles)
When i am rendering with Arnold or Vray or even with simple maya materials blinn, phong, lambert i can see all my textures on the model, in the viewport and in the rendering as well.
But when i am trying to connect the same file node to a DX11 shader i see only the first tile.
What you are suggesting here:
‘’ You can implement a simple, not-very-flexible version of UDIM in a shader by checking the integer part of the UV coord to switch between textures – so if I were going to have two UDIM blocks, i’d pass two textures to my shader and switch between them based on whether the floor(uv.u) is 0 or 1. and so on.’’
is to code the existing DX11 shader in order to read UDIMS?
DX11 is an OSL shader where i can code?
If not where and what should i write in the shader?
Again thank you

For three tiles, you’ have to pass all three textures to the shader as inputs. In the actual fragement shader, you’d sample based on the integer part of the UV coords:

This is pseudcode but should get the idea across. It should be obvious why this won’t scale well beyond a small number of tiles!

float4 color;
float2 tile = floor(myVertexInput.uv);
float2 uv = frac(myVertexInput.uv);
if (tile.x == 0)  
     { color = Tex2D(firstTexture, uv);}
else 
{
    if (tilex == 1)  
          {
          color = Tex2D(secondTexture, uv);
          }
    else 
         {
        if (tilex == 2)  
             { 
             color = Tex2D(thirdTexture, uv);
             }
        }
}
Texture2DArray myTextures;

float indexOfUDIM = floor(myVertexInput.u);

float4 color = myTextures.Sample(sampler, float3( myVertexInput.u, myVertexInput.v, indexOfUDIM));

maybe this work