No Shadows on Terrain

Mostly the first impression in Unity3D is, “why doesn’t work it as it should?”

Example: Shadowing with a Directional light:

The Cube casts shadow to the Plane but not to the Terrain
The Heron doesn’t cast any shadow, even not to the Plane.

Do you have an idea why?

112210--4310--$no_shadows_252.jpg

By default terrain does not cast/receive shadows. Switch it’s lighting mode to Pixel in the terrain settings tab: Unity - Manual: Terrain settings

I suspect the Heron’s shader does not have support for casting shadows. Whether something casts or receives shadows is up to the shader that is used. Probably Heron uses some custom shader and whoever wrote the shader did not implement shadow casting bits.

Hi

Look at the screenshot. Pixel lighting is on. But that cube casts no shadwo. It has a simple diffuse shader with a textur on it.

Does terrain support realtime shadow anyway?

Roman

Hi,

i dont know what a Unity version did you use, but i think realtime shadows are working in unity pro only.

Lars

If you have Unity 2.1+ then shadows are supported on terrain.

One thing to take into consideration is the quality settings: Default is good, that should show some shadows but with restricted casting distance.
Lower won’t show it. Also check if you have set an emulation.

Simple suggestion, make sure you’re working with the latest version of Unity! I stayed on 2.0 for way too long before I remembered to update.

If anyone else has this problem, I solved it this way:
In the tree prefab that the terrain editor uses, I set the leaves material of the tree to Opaque, and got no shadow. But if I also enabled the alpha clipping and slide it back and forth to any value, THEN I got shadows as expected. Odd.

Seeing as this post is from 2009 I doubt it has anything to do with your solution. :smile: