Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice

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

Discussion in 'General Graphics' started by Aiden01, Aug 28, 2023.

  1. Aiden01

    Aiden01

    Joined:
    Jul 3, 2017
    Posts:
    3
    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: WTF..PNG

    Screenshot from editor:
    editor.PNG
     
  2. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,669
    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?
     
  3. Aiden01

    Aiden01

    Joined:
    Jul 3, 2017
    Posts:
    3
    Not that I know of. It is just a regular 1k texture I found.
     
  4. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,770
    To me, this looks like a shader problem. Only way it wouldnt be, is a bad setting/import on the texture used.
     
  5. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    688
    warthos3399 likes this.
  6. Aiden01

    Aiden01

    Joined:
    Jul 3, 2017
    Posts:
    3
    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.
     
  7. kdgalla

    kdgalla

    Joined:
    Mar 15, 2013
    Posts:
    4,669
    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.
     
  8. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    688
    Try unchecking "Optimize Mesh Data" and "Vertex Compression" in the player settings for your target platform.
    https://docs.unity3d.com/Manual/playersettings-windows.html
     
  9. warthos3399

    warthos3399

    Joined:
    May 11, 2019
    Posts:
    1,770
    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...
     
  10. halley

    halley

    Joined:
    Aug 26, 2013
    Posts:
    2,491
    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.
     
    warthos3399 likes this.
  11. c0d3_m0nk3y

    c0d3_m0nk3y

    Joined:
    Oct 21, 2021
    Posts:
    688
    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.
     
    warthos3399 likes this.