Search Unity

Question Model with two UVs wanting to apply two textures in surface shader

Discussion in 'Shaders' started by lofwyre, Nov 16, 2021.

  1. lofwyre

    lofwyre

    Joined:
    Apr 19, 2007
    Posts:
    174
    I have a model with two texture coordinates each being used by different parts of the model. Essentially one is for skin and the other is the clothing texture.

    Is it possible using a surface shader to apply the two albedo textures to the relevant parts of the model? When looking at the documentation on surface shader it seems you have to merge the textures in some way (like with terrain) but I was hoping that I could output the two textures without merging and their rendering would be controlled by the UVs.

    The below example image is a single mesh. The red texture would be mapped using uv1 and the blue mapped using uv2. So there is no intent to fade between etc, I just want two textures applied to a single mesh governed by the UV layout.

    Is this possible with a surface shader?


    multi_uv_example.png

    Thanks
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,342
    The answer is yes, you can. But you should probably just use two materials.