Search Unity

Smooth Height tool behavior at edge of terrain

Discussion in 'World Building' started by DonkeyPotato, Apr 21, 2019.

  1. DonkeyPotato

    DonkeyPotato

    Joined:
    Mar 23, 2018
    Posts:
    28
    It appears that when you use the smooth height tool at the edge of the height map, points on the brush outside the mesh get treated as a value of 0 - so points on the edge of the height map rapidly approach a height of 0 while the other points in the brush area do more reasonable things.

    I can't imagine this ever being expected/useful behavior . Is there any way it'd be possible to make the edge points acts like a clamped texture for purposes of the smooth tool? Meaning, points sampled outside the height map return the value of the height map edge. I would think that'd result in much more reasonable smoothing results.

    Or mask the brush so it only considers points actually on the height map when averaging?
     
    stonstad, gecko and CityGen3D like this.
  2. CityGen3D

    CityGen3D

    Joined:
    Nov 23, 2012
    Posts:
    682
    I agree with this.

    It causes workflow problems in CityGen3D at the moment, where users want to independently work on adjacent terrains, but the smoothing routine creates an artificial drop on the edges, which is not desired if you later want to join terrains together.

    As @DonkeyPotato suggests, it's hard to imagine a scenario where this would be desired behaviour so a fix in BuiltinPaintMaterialPasses.SmoothHeights by masking the brush to the terrain would be preferable to having to retrospectively fix it in code before applying the terrain modification.

    Edit (6/6/20): The heightmap smoothing function in CityGen3D now works without this problem as of v0.91
     
    Last edited: Jun 6, 2020
  3. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    Ya, it's annoying. It's due to the kernel sampling and not discarding out of bounds texels in the height averages. We are looking into a fix to ship with our Terrain Tool package or one that will come as a patch to the package. The artifact gets really bad when you allow the user to bump up the kernel sample distance! Can't say whether or not a fix will get into Editor source anytime soon.
     
  4. DonkeyPotato

    DonkeyPotato

    Joined:
    Mar 23, 2018
    Posts:
    28
  5. wyattt_

    wyattt_

    Unity Technologies

    Joined:
    May 9, 2018
    Posts:
    424
    It will be in the next iteration of those sample tools but available via PackageManager. These will be tools that we developed for 19.1 and 19.2
     
    Rowlan likes this.
  6. gecko

    gecko

    Joined:
    Aug 10, 2006
    Posts:
    2,241
    This was driving me crazy (I mean *really* crazy) -- but then I got Multiple Terrain Brush from the Asset Store https://assetstore.unity.com/packages/tools/terrain/multiple-terrain-brush-2-0-44037 and it handles terrain edges quite nicely. It's annoying that Unity itself can't handle this, but at least there is a tool that does. Using it in 2018.3, happy now. (It also handles painting at terrain edges better -- I was often getting black pixels on the adjacent terrain, but this tool doesn't have that problem)
     
    TheWarper likes this.
  7. stonstad

    stonstad

    Joined:
    Jan 19, 2018
    Posts:
    660
    What is the status of this feature -- has it been released in the package?
     
  8. Ar7ific1al

    Ar7ific1al

    Joined:
    Jan 21, 2014
    Posts:
    54
    Furthermore, completely ignoring this issue in Unity 2018 is unacceptable. Plenty of users are still on Unity 2018, and this issue being present makes using Unity terrain unbearably annoying. I'm using the GitHub terrain tools package which, if this information is correct, I have to assume is now officially abandoned in favor of the package manager version. This leaves us on Unity 2018 in the dust. Not happy.
     
  9. TheWarper

    TheWarper

    Joined:
    Nov 3, 2013
    Posts:
    112
    Last edited: Jun 6, 2020