Search Unity

2021.1 - seemingly corrupt terrain.

Discussion in 'Editor & General Support' started by Jesper-Nielsen, Mar 30, 2021.

  1. Jesper-Nielsen

    Jesper-Nielsen

    Joined:
    Nov 14, 2013
    Posts:
    95
    I've been working on a terrain for a new level for a little while. Luckily I haven't really done any serious work yet because I've mostly been playing around trying to figure out how to lay out the level.
    I also created a few neighbor terrains and after a few hours of playing around the original terrain suddenly reacts very slowly to paint texture and only paints in black - see the left terrain.
    I've tried restarting Unity and also deleting the terrain and creating a new with the same terraindata.
    I get the warning:

    Graphics.CopyTexture called with one texture argument with no mipmaps and texture limit 0. Copy may appear incorrect.
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)


    I wonder if there is anything I can do to avoid this problem, and if the terrain data is irreversibly corrupted if this happens in the future - I do have some other terrains I've been working on for a long time and would hate to see this happen to.

    Edit: If I remove all layers the problem seems to go away and I can at least keep the heightmap but I'm not sure if I would really trust it.
    Edit 2: Exporting the terraindata as a package and importing it in another project also removes the issue.
    upload_2021-3-30_21-25-33.png
     
    Last edited: Mar 30, 2021
    Kurt-Dekker likes this.
  2. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,752
    Don't have any insight about this terrain issue, but you NEED to be using source control if you care about your game data.

    Personally I use git because it is free and there are tons of tutorials out there to help you set it up.

    Here's how I use git in one of my games, Jetpack Kurt:

    https://forum.unity.com/threads/2-steps-backwards.965048/#post-6282497

    Using fine-grained source control as you work to refine your engineering:

    https://forum.unity.com/threads/whe...grammer-example-in-text.1048739/#post-6783740

    Share/Sharing source code between projects:

    https://forum.unity.com/threads/your-techniques-to-share-code-between-projects.575959/#post-3835837
     
    Jesper-Nielsen likes this.
  3. Jesper-Nielsen

    Jesper-Nielsen

    Joined:
    Nov 14, 2013
    Posts:
    95
    Thanks.
    I do back up my project - haven't moved on to actual source control since I'm just myself but I guess for cases like this where data might have gotten corrupted without me knowing it it would be nice to be able to revert to an earlier version and not just to a backup that's also corrupt :)

    I'll give your links a read too.
     
  4. Kurt-Dekker

    Kurt-Dekker

    Joined:
    Mar 16, 2013
    Posts:
    38,752
    Not just for that... a far more common use is you change 57 things to implement a feature and an additional 2 things to test it, and you can't remember what those extra 2 things were... source control shows you and lets you revert ONLY those 2 things so you can keep your full 57 changes for the feature.
     
  5. Jesper-Nielsen

    Jesper-Nielsen

    Joined:
    Nov 14, 2013
    Posts:
    95
    The problem seems to keep popping up randomly for other terrains when I start painting textures on them. Not always but usually after some time and once it happens they stay corrupted even after restarting Unity or deleting the library folder.
     
  6. Jesper-Nielsen

    Jesper-Nielsen

    Joined:
    Nov 14, 2013
    Posts:
    95
    It happened again and after moving all of my assets to a fresh project it stopped happening.
    Then I copied my old project settings too and it happened again.
    I also listened to a bit of advice and got my project under version control - I chose Subversion because it's the one I have the most experience with.
    Narrowed it down to the old QualitySettings file - whenever I use that one the problem consistently reappears. I guess something must have broken when upgrading Unity version.
     
  7. Jesper-Nielsen

    Jesper-Nielsen

    Joined:
    Nov 14, 2013
    Posts:
    95
    I compared the files in TortoiseSvn and they were pretty much identical, except for LOD bias, skin weights and current quality.
    Turns out that current quality is indeed the sinner here - or rather the problem was that it was set to "Low", and I had chosen texture quality: half res.
    Whenever I use low settings the following "warning" appears, the screen freezes for a second and I paint black.


    Graphics.CopyTexture called with one texture argument with no mipmaps and texture limit 0. Copy may appear incorrect.
    UnityEngine.GUIUtility:processEvent (int,intptr,bool&)


    I think I might be able to create a minimal example so I can file a bug report.

    Edit - looks like there's already a similar bug that's marked as fixed: https://issuetracker.unity3d.com/is...555.965231540.1624785741-991340358.1607427944
     
  8. leandromenzen

    leandromenzen

    Joined:
    Aug 26, 2015
    Posts:
    3
    I have the same problem. I couldn't resolve it. I think the only way is to create a completely new terrain. imagemm.jpg
     
    Jesper-Nielsen likes this.
  9. Jesper-Nielsen

    Jesper-Nielsen

    Joined:
    Nov 14, 2013
    Posts:
    95
    Did you try changing to a quality setting with full texture size?
     
  10. rlalancette

    rlalancette

    Joined:
    Sep 20, 2014
    Posts:
    18
    I deal with terrain corruption about every time I rebase from the fork.
    It's almost like GIT does not know what to do with that damn terrain file...
    And, again today :(