Working on a simple custom shader and can’t make it receiving shadows. I’m guessing something changed with the way URP does that but couldn’t find an answer in the unity docs. I’m using 2019.3 beta
Shader "imagoFX/Vertex Colors"
{
Properties
{
_Color ("Color", Color) = (0.5, 0.5, 0.5, 0.5)
}
SubShader
{
Tags { "Queue" = "Geometry"}
CGINCLUDE
#pragma vertex vert
#pragma fragment frag
#include "UnityCG.cginc"
#include "AutoLight.cginc"
uniform fixed4 _Color;
uniform float4 _LightColor0;
struct v2f
{
float4 pos : SV_POSITION;
float4 color : COLOR;
float3 normal : NORMAL;
LIGHTING_COORDS(1,2)
};
v2f vert (appdata_full v)
{
v2f o;
o.pos = UnityObjectToClipPos(v.vertex);
o.color = v.color;
float4x4 modelMatrix = unity_ObjectToWorld;
float4x4 modelMatrixInverse = unity_WorldToObject;
float3 normalDirection = UnityObjectToWorldNormal(v.normal);
float3 lightDirection = normalize(_WorldSpaceLightPos0.xyz);
float3 diffuseReflection = _LightColor0.rgb * max(0.0, dot(normalDirection, lightDirection));
o.color += float4(diffuseReflection, 1.0);
o.pos = UnityObjectToClipPos(v.vertex);
TRANSFER_SHADOW(o)
return o;
}
ENDCG
Pass {
CGPROGRAM
fixed4 frag (v2f i) : COLOR
{
return _Color * i.color * SHADOW_ATTENUATION(i);
}
ENDCG
}
}
FallBack "VertexLit"
}