Search Unity

Terrain How to stop Terrain from blending textures at edges

Discussion in 'World Building' started by JerseyETR, Sep 27, 2021.

  1. JerseyETR

    JerseyETR

    Joined:
    Nov 18, 2014
    Posts:
    3
    Currently have an issue in which a path i am making via texture painting, is leaving faded edges, and I would instead like hard edges.

    The issue I am having can be seen demonstrated here. The solution provided is not a valid one for me.

    https://answers.unity.com/questions/520423/faded-terrain-texture-edges.html


    Its been a number of years since this question was asked in the provided example and I was hoping there would be a new way to solve this.
     
  2. Flavelius

    Flavelius

    Joined:
    Jul 8, 2012
    Posts:
    872
    The explanation provided in the linked thread is just how it works, brushes are based on pixels and can only fill the amount of available pixels in the blend texture and the amount there is what's available for smooth-to-sharp alternation.

    You can create your own custom terrain shader though that you can adjust to step() or otherwise blend certain textures instead of linearly as the default one does. But this will then apply to the whole texture you're targeting by default.
    You may be able to hack around this by using a dedicated texture slot as blend sharpness value provider in your shader, but it's probably not the workflow you're expecting.

    Alternatively if you actually just want everything to blend sharply you can try using microsplat (freee asset store asset), which allows controlling the overall blend sharpness while also allowing height based blending and more. This is probably your best option.
     
  3. JerseyETR

    JerseyETR

    Joined:
    Nov 18, 2014
    Posts:
    3
    Thank you for the well thought out reply. Just what I was looking for, not only a tool or a solution to my fix but education on what the issue actually is and what might work.

    I went ahead and used Microsplat and immediately this gave me the intended result, with a slightly unwanted side effect, in that my intentionally soft textures were overall made much less soft. But this is much more desirable than the blending at edges.

    Again, thanks for the help!
     
  4. jbooth

    jbooth

    Joined:
    Jan 6, 2014
    Posts:
    5,063
    You can adjust the blending contrast on each texture individually with MicroSplat..
     
unityunity