No shadows cast on terrain

It seems that with the default Directional light in Unity, no shadows are cast by osm buildings on the terrain. Is there a way of forcing that?

Shadows work with Cesium OSM Buildings, Cesium World Terrain, and other 3D Tiles tilesets. However, Unity’s default shadow distance is only 40 meters, so you have to be very close to the ground to see them. You can change that in Project Settings. This page explains how:

I found these settings to look pretty good after a couple of minutes of playing with it:
image

Thank you. That explains a lot. I’m sure I saw them for a fleeting moment at one point.

Many thanks

ok, found the details in the URP settings and that’s working great. Does anyone know if it’s possible to make the google maps tileset take shadows? Nothing I do seems to work.

The Google tileset renders in “unlit” mode by default, because its tiles have the KHR_materials_unlit extension. I believe you should be able to force a switch back to the normal lit mode by selecting “CesiumDefaultTilesetMaterial” for the “Opaque Material” property.

1 Like

It works great. I found I had to boost the light intensity though. It was very muddy by default.

I an experiencing some strange and inconsistent bugs with shadows
I am in HDRP.

  1. Depending on the camera orientation and position, shadows sometimes instantly disappear.
    It seems it has something to do with the degree at which the camera is facing a surface on which a shadow is casted. I can sometimes see shadows of gridlines that appear to be the seams between the tiles
  2. In some other locations the shadows simply don’t appear.

Since the problem is not consistent I’ll give the coordinates at which I set the Georeference.
For problem 1. lat: 39.736401 lon: -105.25737 Hei: 2250
For problem 2. lat 1.3521 lon: 103.8198 Hei:100

If you’ve already tried tweaking all of Unity’s shadow settings and it’s not helping, I’m not sure we’ll be able to do much here, as we’re not rendering the shadows. Cesium simply provides static geometry and Unity does the rest.

But if you share some screenshots or videos, we might have some ideas.