Why are the tertures for my cave all distorted when in build.

The underwater project I’ve been making has been working fine this whole time while on the editor but when I finished it and tried to make the build for the demo, every other texture in the game works fine except for the one on the cave. I’ve tried so many things already like, re texturing it on blender, exporting it in different ways, applying different materials, re doing the whole thing but nothing works. I don’t know what to do anymore. I’m currently working on unity 2021.3.15.f1 using the URP.

Screenshot from build:


Screenshot from editor:

Is there anything special about the material or the mesh? Are either of them procedurally generated at runtime? Does the material use a special shader?

Not that I know of. It is just a regular 1k texture I found.

To me, this looks like a shader problem. Only way it wouldnt be, is a bad setting/import on the texture used.

Maybe mesh compression? Don’t really know how that works exactly but that’s the only thing that comes to mind if it’s not shader related.

1 Like

I think it is mesh compression because when I changed it from off to medium I looks distorted in the editor too. Now the question is how do i stop it from compressing on build.

One other, thing- I’ve seen people report a problem with textures not showing properly in a build when they have a scene with >4gb of textures in that one single scene. In those cases the textures where covered in random-dot noise, so it looked different than your screenshot.

Try unchecking “Optimize Mesh Data” and “Vertex Compression” in the player settings for your target platform.
https://docs.unity3d.com/Manual/playersettings-windows.html

Hold on a sec. Compression should never be set to “off”. Just select Normal (medium), for your texture. Its good that you see the same effect in-editor now. Select the material your using with that texture. In the inspector window, youll see “Tiling”, and “Offset”, Play with the “Tiling” values, to make sure that tiling isnt the culprit.

Its just a matter of ruling things out. Your also importing from blender, so there are many variables…

If you’re working with the mesh data IN the game, you will often want to have compression off. That doesn’t apply here, but never say never.

1 Like

I suspect that this is a quantization bug, that mesh compression is storing the u/v coordinates with too few bits.

Even the documentation says that it can cause issues:

If this is in fact the issue, he might have to turn it off globally and enable it on a file-by-file case if desired. However, if this is a PC game, fast load time might matter more than small file size anyways.

1 Like