This seems like it’s still happening for me in 5.6 beta 8 64bit. Here’s the errors I’m getting :
Shader error in 'Chainsawesome/CharactersEffect': 'UnityGetRawBakedOcclusions': no matching 2 parameter function at line 289 (on d3d11)
Compiling Vertex program with SHADOWS_SHADOWMASK
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
Shader error in 'Chainsawesome/CharactersEffect': invalid subscript 'worldPos' at line 289 (on d3d11)
Compiling Vertex program with SHADOWS_SHADOWMASK
Platform defines: UNITY_ENABLE_REFLECTION_BUFFERS UNITY_USE_DITHER_MASK_FOR_ALPHABLENDED_SHADOWS UNITY_PBS_USE_BRDF1 UNITY_SPECCUBE_BOX_PROJECTION UNITY_SPECCUBE_BLENDING UNITY_ENABLE_DETAIL_NORMALMAP SHADER_API_DESKTOP
The shader I’m using looks something like this :
Shader "Chainsawesome/CharactersEffect"
{
Properties
{
Stealth("Stealth", float) = 0.0
[Space]_Color ("Color", Color) = (1,1,1,1)
Saturation("Saturation", float) = 1.0
_MainTex ("Albedo (RGB)", 2D) = "white" {}
EmissionGain("EmissionGain", float) = 1.0
_ColorEmi("Color", Color) = (1,1,1,1)
_Normal ("_Normal", 2D) = "bump" {}
[Space]_Stuff ("AO,Metal,Smooth,Emi", 2D) = "white" {}
_Glossiness ("Smoothness", Range(0,1)) = 0.5
_Metallic ("Metallic", Range(0,1)) = 0.0
StrokesGain("StrokesGain", float) = 1.0
[space]RimPow("RimPow", float) = 1.0
RimGain("RimGain", float) = 1.0
RimEmi("RimEmi", float) = 1.0
[space]AlbedoGain("Gain", float) = 1.0
}
SubShader
{
Tags { "RenderType" = "Transparent" "Queue" = "Transparent+1"}
LOD 200
GrabPass{ "_After" }
CGPROGRAM
#pragma surface surf Standard fullforwardshadows
#pragma target 3.0
uniform sampler2D _MainTex;
uniform sampler2D _Emission;
uniform sampler2D _Normal;
uniform sampler2D _Stuff;
uniform sampler2D _After ;
uniform half _Glossiness;
uniform half _Metallic;
uniform fixed4 _Color;
uniform fixed4 _ColorEmi;
uniform half Saturation;
uniform half StrokesGain;
uniform half EmissionGain;
uniform half RimPow;
uniform half RimGain;
uniform half RimEmi;
uniform half Stealth;
uniform half AlbedoGain;
struct Input
{
float2 uv_MainTex;
float2 uv_Emission;
float2 uv_Normal;
float2 uv_Stuff;
INTERNAL_DATA
float3 worldNormal;
float3 worldPos;
half3 lightDir;
half4 screenPos;
half3 worldRefl;
};
void surf (Input IN, inout SurfaceOutputStandard o)
{
float2 screenUV = IN.screenPos.xy / (IN.screenPos.w + 0.00001);//Avoid zero division on dx11
float3 behind = tex2D(_After ,screenUV );
float4 stuff = tex2D(_Stuff,IN.uv_Stuff);
float AO = stuff.x;
float Metal = stuff.y;
float Smooth = stuff.z;
float Emi = stuff.w;
o.Normal = UnpackNormal(tex2D(_Normal,IN.uv_Normal));
float3 worldNormal = WorldNormalVector (IN, float3(0, 0, 1));
float3 Eye = normalize(_WorldSpaceCameraPos - IN.worldPos);
float rim = 1 - dot(Eye,worldNormal);
rim = pow(rim,RimPow);
rim *= RimGain;
fixed4 albe = tex2D (_MainTex, IN.uv_MainTex) ;
fixed4 c = (albe * _Color * AO + (rim * _ColorEmi)) *StrokesGain;
fixed4 desaturated = (c.x + c.y + c.z) * 0.3333333;
c = lerp(desaturated,c,Saturation);
o.Albedo = c * (1-Stealth) * AlbedoGain;
o.Metallic = _Metallic * Metal* (1-Stealth);
float3 normalEmi = Emi * EmissionGain * _ColorEmi + (rim * RimEmi * _ColorEmi);
float3 StealthEmi = behind + (Emi * EmissionGain * _ColorEmi)+ (rim * RimEmi * _ColorEmi);
o.Emission = Emi * EmissionGain + (rim * RimEmi * _ColorEmi) ;
o.Emission = lerp(normalEmi ,StealthEmi ,Stealth);
o.Smoothness = _Glossiness * Smooth * (1-Stealth);
o.Alpha = 1;
}
ENDCG
}
Fallback "Transparent/VertexLit"
}
Commenting the line seems to fix the issue for some obscure reason, but it can’t be the solution :
o.Normal = UnpackNormal(tex2D(_Normal,IN.uv_Normal));
This issue makes my first build fail systematically which is quite a bummer since it breaks any Continuous Integration we might have. Any tips on why this is happening would be greatly appreciated.
Cheers!