UV Independent Material to prevent texture seams

Hi All,

I have a clothing item I want to to apply a custom texture overlay to. Due to the UVs, it will create texture seams when applying a seamless texture on top of it.

Below are images of my fruitless attempts to use (I) Absolute World Position and (II) World Aligned Textures. Any idea on how to fix this? I was thinking of a triplanar mapping setup?

Any help is much appreciated!


World aligned IS triplanar :slight_smile:

Actually, I think what you have there looks pretty real. Clothing does this in real life ( not the black top, but the red one ).

Thanks for the helping hand, old friend, I appreciate it!

I was thinking about using the first approach (Absolute World Position) despite its flaws. However, turns out that the pattern “updates” as the character animates, i.e. if its world position changes, the placement of the overlay texture changes too. Using local space resulted in something like the black top…

Any idea on how to lock this one in place except baking the texture?

1 Like

Yes, that is a problem :slight_smile:

I know how to solve that for linear movement, but not for rotation :joy:

Looks like you’re stuck with unwrapping. Unless some kind soul passes by here with the rotation correction for world aligned.

Preskinned nodes maybe? https://www.youtube.com/watch?v=wHGIcL0oYmI

1 Like

Yep, Pre-Skinned Local Position definitively works, transforming the world pos to local space does not.
If anyone cares, this is the setup that works properly (or at least as the red shirt above)

I just stumbled across a world aligned setup that does work with rotation and movement

That looks like the setup for triplanar in local space.

Another option is to use a cylindrical projection. Essentially, you map the cylinder around the center Z axis to the U coordinate, and map the extent of the Z axis to the V coordinate. You’ll typically also want wider than tall textures for this, as the diameter is typically longer than the vertical extent.

THAT being said, having spent several years of my career on the problem of “custom clothing for avatars,” my reasoned opinion is that you’ll need to make a “standard” decoration pattern, and then map it to each piece of clothing appropriately using a second texture coordinate.
You might also want to project appliques onto the mesh, as a separate step, as well.

1 Like

Exactly :slight_smile:

Can’t seem to find the fix for the normals though…

The “Triplanar in Local Space” setup however, causes a (“severe”) misalignment with the texture, unfortunately…
However, it fixates the texture onto the mesh and makes it independent to movement distortions.

The “Cylindrical Projection” works like the pre-skinned setup from the video mentioned above. However, it causes a more obvious texture distortion at the UV seams…

On that note, I realized that Quixel Mixer uses a box projection for their texture overlays which yields similar results than the red top in the OP. But since Quixel Mixer bakes the textures, there is no need to fixate the texture…

That’s actually highly surprising! It should be independent of your normal UV channel. Maybe the bounds for local X/Y are somehow off for a skinned mesh? That looks a lot like it thinks “0” is in the right seam of the object, when the offset is supposed to place it smack in the middle.

Actually, maybe the problem is that “Scale UV by center” or “Clothing Pattern Mask” doesn’t like negative texture coordinates. Try adding 0.5 to the U coordinate after dividing by 6.2832.
Try using a regular texture sampler just to make sure it looks OK first.

Triplanar will always have the blend artifact problem. It’s good for rocks and terrain, and for highly angular objects, but not soft meshes IMO.

Thanks for the heads up.
Unfortunately the texture distortion persists even after adding 0.5, using a non-parameterized Texture Sample, and replacing the “Scale UVs by Center” with a simple multiply to achieve the tiling.

That’s disappointing! There’s probably some way to dive into the depth of the shaders to figure out what the bounding box coordinate space is for this skinned geometry, but that feels like a lot of work…

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.