[5.2.2] Unity's default terrain grass ignores Directional Light Shadows with Cookies?

It seems the grass only receives shadows from the defined cookie, all other game objects doesn’t cast shadows on the grass anymore, until you remove the cookie from the directional light.

Anyone can reproduce that?

anyone?

Arg, I have the same issue now :p. No answer to be found.

Solved it now.

Greate a new shader in your project, call it whatever you like.

Replace it’s content with the below.

This is simply the standard grass shader downloaded from Download Archive and then I deleted “exclude_path:deferred” from the end of the #pragma line. With this it works in deferred rendering path.


Shader “Hidden/TerrainEngine/Details/BillboardWavingDoublePass” {
Properties{
_WavingTint(“Fade Color”, Color) = (.7,.6,.5, 0)
_MainTex(“Base (RGB) Alpha (A)”, 2D) = “white” {}
_WaveAndDistance(“Wave and distance”, Vector) = (12, 3.6, 1, 1)
_Cutoff(“Cutoff”, float) = 0.5
}

CGINCLUDE
#include “UnityCG.cginc”
#include “TerrainEngine.cginc”

struct v2f {
float4 pos : SV_POSITION;
fixed4 color : COLOR;
float4 uv : TEXCOORD0;
};
v2f BillboardVert(appdata_full v) {
v2f o;
WavingGrassBillboardVert(v);
o.color = v.color;

o.color.rgb *= ShadeVertexLights(v.vertex, v.normal);

o.pos = mul(UNITY_MATRIX_MVP, v.vertex);
o.uv = v.texcoord;
return o;
}
ENDCG

SubShader{
Tags{
“Queue” = “Geometry+200”
“IgnoreProjector” = “True”
“RenderType” = “GrassBillboard”
“DisableBatching” = “True”
}
Cull Off
LOD 200
ColorMask RGB

CGPROGRAM
#pragma surface surf Lambert vertex:WavingGrassBillboardVert addshadow

sampler2D _MainTex;
fixed _Cutoff;

struct Input {
float2 uv_MainTex;
fixed4 color : COLOR;
};

void surf(Input IN, inout SurfaceOutput o) {
fixed4 c = tex2D(_MainTex, IN.uv_MainTex) * IN.color;
o.Albedo = c.rgb;
o.Alpha = c.a;
clip(o.Alpha - _Cutoff);
o.Alpha *= IN.color.a;
}

ENDCG
}

Fallback Off
}

bump. If you remove “exclude deferred” objects will shine through grass.
Unity 2017.1.2f1, deferred, no cookie on directional light. Light is not Important, and its related to this, I think