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

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:

// vertex-to-fragment interpolation data
// no lightmaps:
#ifndef LIGHTMAP_ON
struct v2f_surf {
  float4 pos : SV_POSITION;
  float2 pack0 : TEXCOORD0; // _MainTex
  float4 tSpace0 : TEXCOORD1;
  float4 tSpace1 : TEXCOORD2;
  float4 tSpace2 : TEXCOORD3;
  fixed4 color : COLOR0;
  half4 custompack0 : TEXCOORD4; // worldTangent_screenPosX
  half4 custompack1 : TEXCOORD5; // worldBinormal_screenPosY
  #if UNITY_SHOULD_SAMPLE_SH
  half3 sh : TEXCOORD6; // SH
  #endif
  UNITY_SHADOW_COORDS(7)
  UNITY_FOG_COORDS(8)
  #if SHADER_TARGET >= 30
  float4 lmap : TEXCOORD9;
  #endif
  UNITY_VERTEX_INPUT_INSTANCE_ID
  UNITY_VERTEX_OUTPUT_STEREO
};
#endif

Hi Jaimi,
Thanks for reporting this. Could you please file a bug report and reply in here with the case #?

Already reported - Case 870523

I’m facing the same issues with Lux, has there been any update on the case?

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”.

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?

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):

1 Like