Search Unity

Something like float2 uv[9] : TEXCOORD0; does not work on android

Discussion in 'Shaders' started by glucosetong, Jan 20, 2021.

  1. glucosetong

    glucosetong

    Joined:
    Aug 10, 2017
    Posts:
    17
    Hello there, after debugging a shader for more than 10 hours, i'll leave my solution in case someone come into this in the future.

    This will work on pc but not on andriod. (OpenGLES3)

    Code (CSharp):
    1. struct v2f_jump {
    2.     float2 uv[9] : TEXCOORD0;
    3.     float4 vertex : SV_POSITION;
    4.   };
    This works on my phone.
    Code (CSharp):
    1. struct v2f_jump {
    2.         //float2 uv[9] : TEXCOORD0;
    3.         float2 uv0 : TEXCOORD0;
    4.         float2 uv1 : TEXCOORD1;
    5.         float2 uv2 : TEXCOORD2;
    6.         float2 uv3 : TEXCOORD3;
    7.         float2 uv4 : TEXCOORD4;
    8.         float2 uv5 : TEXCOORD5;
    9.         float2 uv6 : TEXCOORD6;
    10.         float2 uv7 : TEXCOORD7;
    11.         float2 uv8 : TEXCOORD8;
    12.         float4 vertex : SV_POSITION;
    13.     };
    It is stupid but it works for me :)