Unity Community


Results 1 to 2 of 2

  1. Posts
    1

    Normal values on iOS

    Hi!

    I wrote shader in CG, which is working on PC and MAC, but i have problem with iPhone and iPad. My shader receive some global variables and use some vertex variables. My vertex input struct is:
    Code:  
    1. struct Input
    2. {      
    3.     float4 vertex : POSITION;   
    4.     float4 color : COLOR;
    5.     float3 normal : NORMAL;
    6.     float2 texcoord : TEXCOORD0;
    7.     float2 texcoord1 : TEXCOORD1;
    8. };
    I'm using normal, texcoords in my way, avoiding typical usage. Normals are used to set custom offset/resize of model (when its grow or disapear), texcoords to set graphics effects. Everything working without (i think) normal, because i think on iOS its clamped to -1;1 range. Someone have similar problem? Its possible iOS clamps normals? Other functionalities of shader works without part bounded up with normals.
    Maybe exists special flags for shader compiler?

    Sorry for my english.

    I will be glad for help.


  2. Location
    Osaka Japan
    Posts
    94
    I think it should be like the following-

    float4 _POSITION;
    float4 _COLOR;
    float3 _NORMAL;
    float2 uv_MyTexCoordName;//prefix of uv_ is UV Channel 1
    float2 uv2_MyTexCoordName; //prefix of uv2_ is UV Channel 2
    Lamont G
    Well-fed Hobo
    CGBYLG.com