Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Terrain Puddles - Terrain shader Specularity map

Discussion in 'Shaders' started by sewy, Nov 16, 2016.

  1. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    150
    Hello, I'm trying to make puddle/wet mud effect with Unity terrains. I'm stuck as unity doesn't allow to set specularity map onto terrain shader. I know, there is a way, by writing own terrain shader, but I'm new to shaders and I won't be able to optimize it as good as unity's terrain shader.

    Do you please know about some (not so expensive) way to get one with specularity map option? Or do you recall some other way, how to make it? (Not sure if I wanna make the terrain as mesh)

    I'm using terrain composer so I would prefer some easy interface - in the attachment you can see how it looks like when I'm using Unity's terrain shader. I need to have one more slot for Specular map.
     

    Attached Files:

  2. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    150
    anyone?
     
  3. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    150
    Sucks to answer it by myself, when it's that easy...

    To make nice wet mud effect, it's enough to choose "Built In Standard" Material in terrain settings dropdown menu and use Albedo map with grayscale alpha channel - see attached files (I separated it but it has to be ONE rgb file with alpha channel)

    To make it nicer, place Reflection probe above it - it will reflect skybox as well.
     

    Attached Files:

  4. Stephanides

    Stephanides

    Joined:
    Oct 5, 2014
    Posts:
    12

    I did what you write but i dont have good result, what im doing wrong ?
     
  5. Stephanides

    Stephanides

    Joined:
    Oct 5, 2014
    Posts:
    12
    Here is my result
     

    Attached Files:

  6. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    150
    It looks like it is using aplha chanel as albedo. Do you have it as one file (tif, tga or anything that can use alpha channel? (note that png has it's own style of using alphas)

    I tried it at Unity 5.3.2 now and it's working with no further modifications. Could you please upload your texture somewhere (here or expirebox.com for instance)?
     
    Last edited: Jan 23, 2017
  7. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    Photoshop psd file format is the best and easy to use choice to make the specular map textures.

    Untitled.jpg

    +Normal map
    Untitled.jpg
     
  8. sewy

    sewy

    Joined:
    Oct 11, 2015
    Posts:
    150
    Indeed it is good for testing and experimenting, but due to size it's better to use TGA of TIFF afterwards.

    Thanks for the video, sucks it didn't come earlier :D
     
  9. UnityLighting

    UnityLighting

    Joined:
    Mar 31, 2015
    Posts:
    3,866
    File type is not important. When you import a image into project, Unity convert it to platform specific format.
    Don't forget to watch the part 2 for normal mapping