Search Unity

UV Set modification on an example shader?

Discussion in 'Shaders' started by Kloper, Sep 13, 2018.

  1. Kloper

    Kloper

    Joined:
    Jan 28, 2014
    Posts:
    93
    Hi,
    I dont know anything about shader programming, but I found a shader that does almost exactly what I need..
    The only modifications that I need is that Texture 1 needs to use UV Set 0 and Texture 2 needs to use UV Set 1. I don't need an option to change that, it can be hard coded.
    Hope anybody can help me out here.

    Thanks!!

    Code (CSharp):
    1. Shader "Blend 2 Textures" {
    2. Properties {
    3.     _Blend ("Blend", Range (0, 1) ) = 0.5
    4.     _MainTex ("Texture 1", 2D) = ""
    5.     _Texture2 ("Texture 2", 2D) = ""
    6. }
    7. SubShader {  
    8.     Pass {
    9.         SetTexture[_MainTex]
    10.         SetTexture[_Texture2] {
    11.             ConstantColor (0,0,0, [_Blend])
    12.             Combine texture Lerp(constant) previous
    13.         }      
    14.     }
    15. }
    16. }
    17.