Search Unity

How does Terrain shader works?

Discussion in 'Shaders' started by rabirland, Apr 25, 2017.

  1. rabirland

    rabirland

    Joined:
    Nov 22, 2014
    Posts:
    29
    I doesn't mean the basic work (Tex 1-4 in first pass, 5-8 in AddPass, 8-12 in AddPass etc...)
    I mean how can I set for example 10 texture in my own script in the shader?
    Because I would like to use the Terrain Shader on my Voxel Engine, but I couldn't find any solution how can I specify the AddPasses and their textures for each.
     
  2. TJHeuvel-net

    TJHeuvel-net

    Joined:
    Jul 31, 2012
    Posts:
    838
    You can download the source of all Unity's shaders and see for yourself.
     
  3. rabirland

    rabirland

    Joined:
    Nov 22, 2014
    Posts:
    29
    I've downloaded. All it does is inlude the AddPass once. After that I don't understand
    1; How can I set the AddPass's properties from a script.
    2; How can I insert / use the AddPass multiple times, so I would use 10+ textures.
    The Terrain script is not Open Surce (as I know)