Search Unity

Multiple layers of tiled textures?

Discussion in 'General Graphics' started by nicmarxp, Mar 16, 2018.

  1. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    Let's say I have an UV-mapped mesh, a flat plane for example. And I have three textures, like sand, mud, grass. Is it possible to paint this in different layers? For example sand in the bottom, mud above, and the grass on top like the image below (Planetary Annihilation).

    The ideas is to just use three small tiles, and not one huge texture across the entire mesh. If this is possible, where is the actual painted data stored?

    I'm working in Blender with meshes, but I'm having troubles bringing them into Unity, without manually applying the textures in Unity, but that might be a different question, but I assume I would need the three different textures in Unity somehow.

    I tried searching for this, but I'm not sure what the technique is called.

    Thanks in advance for any ideas!

     
  2. McDev02

    McDev02

    Joined:
    Nov 22, 2010
    Posts:
    664
    The technique is called splatmap. This is the default techniqe for Terrains so it is for Unity terrain.
    You usually use a texture which defines which layers are vissible. Alternatively you can use vertex colors for that.
    If you are not fit with unity shaders search for splatmap or layer shaders or try out the new Unity Shader Graph.
     
  3. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    Thanks a lot, I'll check that out!
     
  4. nicmarxp

    nicmarxp

    Joined:
    Dec 3, 2017
    Posts:
    406
    I found an asset called Microsplat which seems to let you paint on terrain and do all sorts of antitiling and cool stuff. However I was using a mesh for the level map, but if I understand this correctly, this only works on Unity terrain objects, like you wrote above.

    Does this mean I can't use the same asset on other meshes, or do I have to do my own shaders for that? I messed around with Blender and the node editor, and the Unity Shader Graph seems to be similar.

    I'm not sure what I'm asking here, it's just that Microsplat seemed so awesome, so it would be cool to use it on other assets too. But we'll get to that later. :)