Looking for a way to crop a texture to the visible part with a node

Hi Guys (and Girls),

I’m currently working on a Vertex Paining Material for my project. I’m using 5 diffrent PBR Materials. 1 of these Materials is 1 of the Textures with Water applied to it. Since I’m using PBR I have 4 Textures for each Material, which means in total I have more than 16 Texture Samples, which means I get an error when trying to safe the Material (to many texture samples). To work around this Problem I merged 4 of these Materials into 1 Material, by doubling the texture size from 1k to 2k. I then use a graph that zooms in the Texture and frames the part I need, to split the texture back into the 4 diffrent Materials.
Below you can see the part of my graph that zooms into the texture and frames the needed part. The Texture object on the Right/Top is the whole Texture, the selected 3 Nodes are my outcome Textures From 1 Material.

This works fine so far, except for 1 problem. If I have a model that uses UV’s outside the 1:1 UV space, I can see the other Materials, which leads to some annoying parts on my model. As you can see below.

This is because the texture is only zoomed and framed by my graph and not cropped.
Of course I could split my Poly at that Line so I can map them perfectly 1:1 UV Space, however I would rather
be able to crop the texture after Framing it. I have already found the TextureCropping Node, but I can’t get it to work.
It would be great if somebody could help me by either showing me to crop my Texture without the TextureCropping Node, or explain to me how it works.

Thanks for your help.

ChaosPanda

anybody got an idea?

You can actually use up to 128 texture samples! This is made possible by picking shared samplers per TextureSample node instead of always using the UTexture asset settings.

Is there any information on what that actually does (except for allowing you to use up to 128 texture samples)?

so there are no real downsites to using the shared setting? Like performance etc.?

well, since even if you do crop the 2048*2048 textures you will always notice a weird seam where the new texture begins. (especially when the texture MipMaps)

So instead of merging multiple textures into one, if you use the shared option you can have all the texture samples you need without using convoluted techniques that wont have any decent results.

I think the clamp version only repeats the texture once, while wrap makes it seamless/endless.