Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Error compiling shader after upgrading to 5.6B3:unrecognized identifier 'UNITY_SHADOW_COORDS'

Discussion in '5.6 Beta' started by Jaimi, Jan 14, 2017.

  1. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    I'm testing the UMA project under 5.6b3.

    Compiling the shaders gives the following error:

    unrecognized identifier 'UNITY_SHADOW_COORDS' at line 203 (on metal)
    unrecognized identifier 'UNITY_SHADOW_COORDS' at line 136 (on glcore)

    I didn't see anything in the upgrade guide about shader changes, and google returns zero results on this macro.


    This is a surface shader, and the usage appears to be in a struct in the generated source:

    Code (CSharp):
    1.  
    2. // vertex-to-fragment interpolation data
    3. // no lightmaps:
    4. #ifndef LIGHTMAP_ON
    5. struct v2f_surf {
    6.   float4 pos : SV_POSITION;
    7.   float2 pack0 : TEXCOORD0; // _MainTex
    8.   float4 tSpace0 : TEXCOORD1;
    9.   float4 tSpace1 : TEXCOORD2;
    10.   float4 tSpace2 : TEXCOORD3;
    11.   fixed4 color : COLOR0;
    12.   half4 custompack0 : TEXCOORD4; // worldTangent_screenPosX
    13.   half4 custompack1 : TEXCOORD5; // worldBinormal_screenPosY
    14.   #if UNITY_SHOULD_SAMPLE_SH
    15.   half3 sh : TEXCOORD6; // SH
    16.   #endif
    17.   UNITY_SHADOW_COORDS(7)
    18.   UNITY_FOG_COORDS(8)
    19.   #if SHADER_TARGET >= 30
    20.   float4 lmap : TEXCOORD9;
    21.   #endif
    22.   UNITY_VERTEX_INPUT_INSTANCE_ID
    23.   UNITY_VERTEX_OUTPUT_STEREO
    24. };
    25. #endif
     
  2. LeonhardP

    LeonhardP

    Unity Technologies

    Joined:
    Jul 4, 2016
    Posts:
    3,136
    Hi Jaimi,
    Thanks for reporting this. Could you please file a bug report and reply in here with the case #?
     
  3. Jaimi

    Jaimi

    Joined:
    Jan 10, 2009
    Posts:
    6,208
    Already reported - Case 870523
     
  4. ArthurT

    ArthurT

    Joined:
    Oct 26, 2014
    Posts:
    75
    I'm facing the same issues with Lux, has there been any update on the case?
     
  5. Zomby138

    Zomby138

    Joined:
    Nov 3, 2009
    Posts:
    659
    I'm getting this when trying to use the blacksmith unique shadows. On the issue tracker page it says that the status of this bug is "By Design".

    https://issuetracker.unity3d.com/is...-unity-shadow-coords-at-line-203-shader-error

    What does this mean? Is it not going to be fixed because it's a deliberate change? Surely there should be some sort of explanation so we can update our shaders?

    Edit: Actually my error is slightly different. I get this:

    Shader error in 'Volund/Standard Character (Specular, Surface)': invalid subscript '_ShadowCoord' 'UnityComputeForwardShadows': no matching 3 parameter function at line 201 (on d3d11)

    Seems to be very similar?
     
  6. kemalakay

    kemalakay

    Unity Technologies

    Joined:
    Jul 12, 2016
    Posts:
    224
    Hey @ArthurT

    This is related to Lux asset and until it is upgraded to work with 5.6, here is a workaround solution suggested by our developer Florent (Jaimi received this as a e-mail):

     
    ArthurT likes this.