Search Unity

Question HDRP Terrain Shaders

Discussion in 'Shader Graph' started by fletch254, May 2, 2020.

  1. fletch254

    fletch254

    Joined:
    Dec 2, 2014
    Posts:
    6
    I've been playing around a little with shaders on regular meshes and wanted to try my hand at something I've been looking forward to for a while; making a terrain shader which automatically dictates the materials on certain parts of the terrain (rock textures for steeper inclines, snow-capped peaks for terrain at a certain elevation etc).

    The problem I've hit is what seems like the first hurdle - actually applying a shader-based material to the terrain in the first place. I have a project set up with the standard HDRP (the option when you first create the unity project) and added a terrain. I changed the Material option for the terrain to a new Material that I set to use the HDRP/TerrainLit shader. All is fine there.

    It's at this point I want to apply my own shader to the material but when creating a new shaders there's no option for a TerrainLit shader. If I try any other type of shader and apply that to the material my terrain goes invisible; I think I understand why. What I don't understand is why I can't create my own Terrain Shader. Is this something that I would have to code from scratch and not use the ShaderGraph UI for?

    If anyone could point me to any information about this sort of setup be it video tutorials or written documentation that would be great - my Google-Fu hasn't produced anything useful to me so far.

    Thanks in advance!