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

Replacement Shaders - what RenderType is terrain?

Discussion in 'Shaders' started by JRW_WSP, Aug 3, 2018.

  1. JRW_WSP

    JRW_WSP

    Joined:
    Jun 26, 2017
    Posts:
    37
    I've been experimenting with Replacement Shaders and am currently replacing based on the RenderType tag. As far as I can work out Terrain is the "Opaque" render type but for some reason it is still not rendering. Is this a bug or have a got the wrong rendertype for terrain? Anyone know?

    Cheers!
     
  2. Przemyslaw_Zaworski

    Przemyslaw_Zaworski

    Joined:
    Jun 9, 2017
    Posts:
    327
    Shader replacement basic configuration:
    Code (CSharp):
    1. https://github.com/przemyslawzaworski/Unity3D-CG-programming/tree/master/ShaderReplacement
    Terrain shader:
    Code (CSharp):
    1. https://github.com/przemyslawzaworski/Unity3D-CG-programming/blob/master/terrain_shader_tessellation_diffuse.shader
     
  3. JRW_WSP

    JRW_WSP

    Joined:
    Jun 26, 2017
    Posts:
    37
    Thanks for the shaders but it turns out that my code was doing exactly what I asked of it - it's just that the color coming through from the terrain was black so I mistakenly thought it wasn't working. So if anyone else ends up thinking along the same lines as me - rest assured the terrain shader is indeed "RenderType" = "Opaque".
     
  4. freehyan

    freehyan

    Joined:
    Nov 27, 2017
    Posts:
    7
    hello, Did you solve this problem?