Search Unity

how to use v2f 6 pic uv ?

Discussion in 'Shaders' started by dreamerflyer, Mar 14, 2017.

  1. dreamerflyer

    dreamerflyer

    Joined:
    Jun 11, 2011
    Posts:
    927
    i want to use 6 layer uv to make a map tile,but 5,6 layer not work, how to fix this?target 3.0 still not work map.jpg
     
  2. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    You might be running out of vertex shader outputs. Try using a float4 instead and pack two UVs per vertex output variable, i.e.:
    o.uv0uv1 = float4(TRANSFORM_TEX(_Tex0, i.uv), TRANSFORM_TEX(_Tex1, i.uv));

    Alternatively, just do the TRANSFORM_TEX() in the fragment shader, they're extremely cheap, and it may actually be faster than transferring all that data from the vertex shader to the fragment (if you're not using this for mobile).
     
    dreamerflyer likes this.