Search Unity

Terrain Tools: Install errors and Noise not working

Discussion in 'World Building' started by ChekbooM_EM, May 29, 2019.

  1. ChekbooM_EM

    ChekbooM_EM

    Joined:
    Jul 3, 2017
    Posts:
    3
    Hi,

    I've just installed the Terrain Tools package (1.1.2) and it's full of great stuff, thanks!

    But I ran into errors when installing it in a brand new HDRP project (See attached image)
    I still can use the Terrain Toolbox and all the sculpting tools except the Sculpt/Noise tool that doesn't generate any preview and spams the Console with the following error:


    UnauthorizedAccessException: Access to the path "D:\Unity\TestProject\Library\PackageCache\com.unity.terrain-tools@1.1.2-preview\Shaders\NoiseLib\Fbm\Billow.hlsl" is denied.
    System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options, System.String msgPath, System.Boolean bFromProxy, System.Boolean useLongPath, System.Boolean checkHost) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,System.IO.FileOptions,string,bool,bool,bool)
    System.IO.StreamWriter.CreateFile (System.String path, System.Boolean append, System.Boolean checkHost) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize, System.Boolean checkHost) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    System.IO.StreamWriter..ctor (System.String path, System.Boolean append, System.Text.Encoding encoding, System.Int32 bufferSize) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    System.IO.StreamWriter..ctor (System.String path) (at <1f0c1ef1ad524c38bbc5536809c46b48>:0)
    (wrapper remoting-invoke-with-check) System.IO.StreamWriter..ctor(string)
    UnityEditor.Experimental.TerrainAPI.NoiseLib.GenerateHeaderFiles () (at Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Editor/TerrainTools/NoiseLib/API/NoiseLib.cs:613)
    UnityEditor.Experimental.TerrainAPI.NoiseLib..cctor () (at Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Editor/TerrainTools/NoiseLib/API/NoiseLib.cs:40)
    Rethrow as TypeInitializationException: The type initializer for 'UnityEditor.Experimental.TerrainAPI.NoiseLib' threw an exception.
    UnityEditor.Experimental.TerrainAPI.NoiseUtils.GetDefaultBlitMaterial (UnityEditor.Experimental.TerrainAPI.NoiseSettings noise) (at Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Editor/TerrainTools/NoiseLib/API/NoiseUtils.cs:76)
    UnityEditor.Experimental.TerrainAPI.NoiseUtils.Blit2D (UnityEditor.Experimental.TerrainAPI.NoiseSettings noise, UnityEngine.RenderTexture dest) (at Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Editor/TerrainTools/NoiseLib/API/NoiseUtils.cs:143)
    UnityEditor.Experimental.TerrainAPI.NoiseSettingsGUI.DrawPreviewTexture (System.Single minSize, System.Boolean showExportButton) (at Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Editor/TerrainTools/NoiseLib/NoiseSettingsGUI.cs:297)
    UnityEditor.Experimental.TerrainAPI.NoiseHeightTool.OnInspectorGUI (UnityEngine.Terrain terrain, UnityEditor.Experimental.TerrainAPI.IOnInspectorGUI editContext) (at Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Editor/TerrainTools/NoiseHeightTool.cs:225)
    UnityEditor.TerrainInspector.ShowPaint () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1375)
    UnityEditor.TerrainInspector.OnInspectorGUI () (at C:/buildslave/unity/build/Modules/TerrainEditor/TerrainInspector.cs:1784)
    UnityEditor.UIElements.InspectorElement+<CreateIMGUIInspectorFromEditor>c__AnonStorey1.<>m__0 () (at C:/buildslave/unity/build/Editor/Mono/Inspector/InspectorElement.cs:445)
    UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)



    My setup:
    Unity 2019.1.0f2
    Windows 10

    Thanks,
    Alex
     

    Attached Files:

  2. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Hey! Thank you for sharing. I will look into it.
     
  3. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    I got this as well and it's reproducible all the time in 2019.1.3f1. Console error shows up right when I start Unity with my project, no terrain selected. If you want me to test something or need an example project, just hit me up. I can submit a bug report as well if you prefer.
     
  4. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    "Great job, Wyatt. You broke stuff."

    Can you submit a bug report with repro project and share the link in this thread
     
  5. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    For some context, this error is occurring because I am generating some shaders in the package and writing them to disk but the package cache is read-only. Those shaders should also not be generating at all since they are already included in the package and the shader templates for them won't ever change because, again, they are read-only. For some reason, I haven't been able to repro this yet but I am looking for a fix and will hopefully get an update out soon
     
  6. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    Uploading ... for some reason the upload to the Unity servers takes a long time. I guess it'll be done within an hour. I'll bump this thread once it's finished.
     
  7. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Cool. Thank you, kindly
     
  8. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    Thank you for the tools :)

    It's report "(Case 1159025) System.UnauthorizedAccessException".

    Do you have access to it using the id? In the mail it says it's not recommended to share the link, i. e. "Note that sharing it will also share all your other cases and email conversations in them." If you need the link, let me know and I'll send it to you via pm.
     
  9. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Good to know. ID should be fine
     
    Rowlan likes this.
  10. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    And of course, your project works on my machine... Maybe I need to clear my system-wide package cache
     
  11. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    @Rowlan @ChekbooM_EM are either of you able to edit package manager files in YourProjectFolder/Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Shaders/Generated?

    If you run the Unity Editor with Administrator privileges, do the errors go away?
     
  12. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    No, I can't edit the files. The errors don't go away when I run the Unity Hub or Unity Editor in Administrator mode.

    (Win 10 Home Edition)
     
    Last edited: May 31, 2019
  13. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    @wyatttt It appears the file has flag "Read only" and that's why it can't be changed. When I remove the flag, the error goes away, but then other hlsl files follow with the same error. When I remove the "Read only" flag on all of them, I get this:

    Shader error in 'Hidden/TerrainTools/Noise/NoiseBlit/NoiseBlitFbm': incorrect number of arguments to numeric-type constructor at /Test/Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Shaders/NoiseLib/Fbm/Billow.hlsl(53) (on d3d11)

    Shader error in 'Hidden/TerrainTools/NoiseFill/NoiseFillFbm': incorrect number of arguments to numeric-type constructor at /Test/Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Shaders/NoiseLib/Fbm/Billow.hlsl(53) (on d3d11)

    Shader error in 'Hidden/TerrainTools/NoiseFill': incorrect number of arguments to numeric-type constructor at /Test/Library/PackageCache/com.unity.terrain-tools@1.1.2-preview/Shaders/NoiseLib/FBM/Perlin.hlsl(53) (on d3d11)
     
  14. chmodseven

    chmodseven

    Joined:
    Jul 20, 2012
    Posts:
    120
    I have come across a null reference exception when Terrain Tools is installed, and any item in the hierarchy other than the scene root is selected and showing in the inspector.

    I have logged a bug report but the email ID hasn't come through yet, so I thought I'd mention it here too.

     
  15. ChekbooM_EM

    ChekbooM_EM

    Joined:
    Jul 3, 2017
    Posts:
    3
    Hi guys,

    It seems to be related to a locale issue:
    By default, my computer regions settings are set to French(Canada) with the decimal symbol set to "," instead of "."
    When I switched to English (United States) all the errors went away and I'm now able to use the Noise brush properly.

    So on Windows, just go to Control Panel/Clock, Language and Region/Change Location and set the Format to English.
    Locale Settings.png

    I hope there will be a better fix going forward, as I had similar issues with Houdini Engine curves some time ago.

    Thanks!
    Alex
     
    wyattt_ likes this.
  16. rchagot

    rchagot

    Joined:
    Mar 18, 2019
    Posts:
    1
    Hi, I'm working with @ChekbooM_EM .
    Here's more info:
    UnityEditor.Experimental.TerrainAPI.NoiseLib.GenerateHeaderFiles(), generates the shader code in memory and compares the code with the package shader files (e.g: Shaders/NoiseLib/FBM/Billow.hlsl).
    Depending on Windows region settings, the locale will change the decimal symbol used while converting float to string (comma instead of dot):
    Code (CSharp):
    1.     ret.warpStrength = 0,5;
    2.     ret.warpOffsets = float4(2,5, 1,4, 3,2, 2,7);
    Since it's different, it will try to write the file which is read-only...

    Looks like the source of the problem lies within UnityEditor.Experimental.TerrainAPI.HlslInput.GetDefaultValueString():
    ToString() and string.Format(...) should likely pass CultureInfo.InvariantCulture. I'm not sure whether a wider solution could be implemented, I leave this up to you ;)
    Note: There might have more locations where this is needed, I didn't dig any further.

    P.S:
    IIRC, I deleted the project Library/PackageCache + Library/ShaderCache in order to reproduce the issue after changing the system locale
     
    Last edited: May 31, 2019
    Rowlan and wyattt_ like this.
  17. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    I believe you are absolutely correct regarding this one. Thanks!
     
  18. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Ya it's read-only but we ship the package with the generated file so it shouldn't be attempting to write there which is what I am confused about. Either way, working on a fix.

    I think the errors you get after removing the read-only status is from the locale commas versus periods thing when generating floating point strings values
     
    Rowlan likes this.
  19. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Last edited: Jun 3, 2019
    Rowlan, rchagot and ChekbooM_EM like this.
  20. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Oh you know what! The CultureInfo thing is why it's trying to regenerate the shader files. The only diff between the generated file and the one we ship with the package is the commas/decimals... And that's why it keeps trying to write to that file location

    Ok. well now I am checking if the file is readon-only and going to use the invariant cutlure info. Should be good then. Thank you all for the help!
     
  21. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    UPDATE: Looks like we will have to wait until Monday next week to get an updated package out. Sorry, folks. This was an oversight on my part. I hope you are enjoying the rest of the tools at least!
     
    Last edited: Jun 1, 2019
    rchagot and ChekbooM_EM like this.
  22. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    What about my ticket, should i ask to close it? I don't want anyone waste their time in checking it out when a fix is already on the way. I'll update the ticket by mentioning this thread.
     
  23. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    @wyatttt I just tried to fix it myself when I noticed several of these hardcoded paths:

    Would it be possible to make those paths relative? Or is this the way the packaging stuff is supposed to work, I'm not familiar yet with that stuff :)
     
  24. supaworst

    supaworst

    Joined:
    Mar 26, 2012
    Posts:
    45
    Thanks wyattt, on Monday i'm going to test it and i'll give you a feedback. Anyway, all the new terrain stuff seems to be very promising, the only thing that is missing is just the material part. Add that and it will be a killer package!
     
    wyattt_ likes this.
  25. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    This is how you reference files that are in packages
     
    Rowlan likes this.
  26. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    I'll close it once things are merged into the release branch for the package.
     
    Rowlan likes this.
  27. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Materials will be 2019.2!
     
  28. Rowlan

    Rowlan

    Joined:
    Aug 4, 2016
    Posts:
    4,294
    Thank you. One more question if I may: I understand this is required for explicit addressing of external packages and getting unique addressability without name clashes. But what about contents within the same package? Shouldn't there be a placeholder variable or something so that whenever the package structure changes you don't have to correct each and every occurrence of an address? That kind of reminds me of Unity when variables are referenced as strings rather than object reference. Makes safe refactoring rather impossible.
     
  29. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    A static variable representing partial paths could be helpful. Maybe have a static class called PackageInfo with paths to the shader folder, content folders, etc.

    Could also potentially use the Asset GUIDs
     
    Rowlan likes this.
  30. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Just published fixes for this (I hope). Package version is 1.1.4
     
  31. ChekbooM_EM

    ChekbooM_EM

    Joined:
    Jul 3, 2017
    Posts:
    3
    It works perfectly, thank you so much @wyatttt
     
    wyattt_ likes this.
  32. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Great to hear! Thank you for confirming!
     
  33. Dude_Loe

    Dude_Loe

    Joined:
    Mar 28, 2018
    Posts:
    7
    Hey @wyatt I scrolled through here to find a solution to my problem but I don't think there is, so I just need you to verify this. Is the terrain tools not supported in Unity 2020.2? I can't find anything in the package manager, so I went to the Asset Store, and imported the terrain tools sample thing, but I only got the samples, no tools at all...
     
    Rowlan likes this.
  34. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    It is but it's just not showing up in Package Manager atm
     
    Rowlan likes this.
  35. Aykutkaraca

    Aykutkaraca

    Joined:
    Jan 4, 2018
    Posts:
    33
    I still have this error. Running on Deepin Linux and Unity 2019.4.9f1 and I get:

    The following files have the same name but only differ in casing and will be ignored:
    Packages/com.unity.terrain-tools/Shaders/NoiseLib/FBM
    Packages/com.unity.terrain-tools/Shaders/NoiseLib/Fbm
    Case sensitive file systems are not fully supported, please move or rename these files.

    However if I remove or rename the folders and .meta files. They appear again.
     
    wyattt_ likes this.
  36. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    I just made a fix for the Linux warnings and import issues. Will be in the next package release.
     
  37. Aykutkaraca

    Aykutkaraca

    Joined:
    Jan 4, 2018
    Posts:
    33
    Yes I also got the email on my bug report but the question is "when the fix will be released?" :)
     
  38. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    I cannot say. Secrets. Secrets. :p

    We're going through a good portion of our bugs atm so once those are done perhaps
     
    Aykutkaraca likes this.
  39. bmbzzx1

    bmbzzx1

    Joined:
    Jan 26, 2021
    Posts:
    2
    HI! I've just installed terrain tools v2.6. i have of the same 40 errors which say (isReadable is false;ReadWrite must be enabled in import settings) I also can't create a terrain in terrain tools. Is there a fix for this?
     
  40. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Heya! Could you share the error text that you are seeing? Could you also double-check the version number? I don't recall us having a 2.6 version. I will double-check on my end as well