Is there a trick to laying out UV in a way that Unreal won't mess it up?

I have one 4k texture set for a whole bunch of assets at once:

The problem is, inside Unreal unless I toggle “use full precision UVs” on most of those assets, the textures look warped in some parts and/or lose important details like edge highlights and normals in correct places.


I would imagine that having hundred of meshes with “full precision UVs” is not great. I don’t think it’s gonna matter THAT much, but still it’s worse for optimization as a matter of fact.

Is there some trick to laying out UVs in a way that would minimize impact of Unreal rounding up UV coordinates from 32 bit to 16 bit?

Are you sure the textures aren’t down-sampled after the import happens? (set to a lower resolution than the source).

This would make the texture have less pixel density causing it to seem stretched and become slightly blurry. It could also move the pixels near the island edges.

You could also use UDIMs to go out of the 0-1 range and precision wouldn’t be that much of a factor.

Nah, it’s not the first time I encounter this. But usually it’s maybe one or two assets per pack that require full precision UVs to be toggled.
This time, however, since it’s a lot of different modular pieces packed into single 4k texture, a bunch of them required full precision UVs to be toggled.

From the documentation:

By default static meshes use half precision (16 bit) UVs in order to save memory. Enabling this option forces the mesh to use full precision (32 bit) UVs. This might be needed for certain cases when seeing artifacts with texture mapping the mesh.

If I somehow managed to downsample 4k texture, it would’ve been extremely noticeable on the props, because it halves texel density. So it’s not that.

I was thinking maybe there’s some sort of tech or a trick that I’m not aware of, that would help to unwrap UVs in a way that Unreal won’t need to approximate the coordinates.

according to google maya has an option called pixel snap. to center or to corners. this is present in most other popular modelling tools aswell. this avoids loss of precision due to subpixel, or better said, subtexel uv locations. this rounding error is what distorts it in unreal. the 16 bit float format has limited numerical precision for those subtexel locations. pixel snap should reduce that error. you gotta do it before you paint tho. so… this is an advice for the future assets. probably not this uv sheet.

1 Like

Hm… I didn’t even know how to correctly formulate my google search for what I’m trying to solve. So my results never gave me any info about pixel snap.
However, now that I googled pixel snap itself, I should give it a try in the future (I’m not gonna re-bake every single texture in my asset pack now :smiley: ).

The problem is, I can’t seem to find any info on how to snap all the UVs to pixels automatically… Everything that I see is manually snapping individual UV’s to either pixel corner or pixel center.

dunno how maya does it, rn. if it works like blender, you just select all of it and drag it lil for it to recalculate and autosnap all of it.

Unfortunately, it works the same way as with other snapping options - if I select all the UVs I want to snap to pixels and move it, it will just snap the pivot point of my selection, meaning I’m simply moving all the selected UV’s per pixel, while keeping them at the same distance and position from each other. If that makes sense?

you cannot auto snap any selection? ohh well. but… yeh. that makes sense. bummer on the maya side of old things. maybe you wanna move to blender? :sweat_smile: it can do that. : )

or maybe find a mel script that does that. ; )

I found a workaround.
If I select a bunch of UVs, and then select lattice tool, set falloff to 0, and just touch the middle circle thingie in the lattice, it will snap all the individual UVs to pixels, as long as I have pixel snap enabled.

However, now I run into another problem:

These cylinder caps are all messed up T_T

hmm. that is the thing with limited resolution or things being very small in the unwrap. nothing you can do about. but work with it.

is the snapping resolution correct tho? this looks pretty far off, compared to your first screenshot. this all looks like it should snap to 4k without much issues.

1 Like

Oh, not at all. I was just testing it with 512p texture applied to the material. What I’m snapping, however, are UVs in lightmap channel. Again, purely for testing purposes. Texel density is 4.77 with 512 texture. So it’s pretty low.
If I try it with higher texel density, like 12, for example, then the circle looks like a circle after snapping UVs.

So, basically, yes, I found a solution that I should incorporate in my future work.
Thank you very much for the help!

1 Like

Ok, update on the issue.

Pixel snap doesn’t seem to solve it. Even though, in theory, it should.

Left - my original textures bake. Middle - UVs were pixel snapped to pixel corners on 8k texture (tried with 4k with the same result), textures re-baked. Right - full precision UVs.

looks good for the most part. maybe 1 or 2 uvs a lil off. you just rebaked anyway, tho. thought i mentioned you should do the pixel snap before you paint. this is no retro fit method.

Yeah I re-imported baked normals, occlusion, convexity to quixel mixer, re-baked final textures there, and this was the result.

It doesn’t look too bad here, however some of the other meshes look much worse.
This one for example (it’s a similar piece that uses similar caps):

And this is with pixelsnap and rebaked textures.
This is how it looks like with full precision uvs:

Normally it wouldn’t be too noticeable, because these props are quite small. However, I just want to find a solution to not deal with this any more!

You should plan your textures with spill over values on the edges much like when preparing materials for print. That way if the edges don’t line up you don’t end up with weird shimmering or backgrounds poking at the edges.

I didn’t really plan for that to happen. This is just texture padding that was automatically applied in Mixer. And the padding isn’t an issue really, because pretty much the same thing happened if I apply “raw” textures from Marmoset (that also generates padding).
Because of the UV distortions due to converting from 32 bits to 16 bits, the normals get warped - is the main issue.
Not only that, but the whole cap went to the side, making one part of it appear thinner, and the other - thicker.
And how do you plan the textures with “spill over” exactly? Besides leaving padding, which I did.

If only I could find a solution to make my UVs to use 16 bit coordinates to begin with, this would completely fix everything :\

you could add a feature request. does autodesk have any form of developer contact? i dunno.

I’d be waiting for 8 years for it to be implemented xD

I’m planning to try out RizomUV in the near future. Maybe it will do better than Maya. I’ll report back with the results whenever I get to it.