How to disable Shadow Casting "RECEIVE_ONLY" on Tileset?

From the Cesium docs I have found some mention of “RECEIVE_ONLY” mode but I am unable to find any way to utilize this option in Cesium for Unity (1.16.0) plugin.

Is there any way to disable shadow casting on from the tiles while still receiving shadows?

I have tried adding the tag: “ForceNoShadowCasting”=“true” in the default Cesium (built-in) shader, but then neither shadow casting or receiving is working and the shader no longer writes to the camera depth buffer making this not a ideal solution.

But the Cesium3DTileset compeont is not a mesh renderer and lacks the Cast Shadows dropdown like the default MeshRendere component.

I am trying to have my character cast shadows from a directional light onto the 3d tiles. However when the tiles are allowed to cast shadows they flicker from the mesh culling and I really need to disable shadow casting since the ground textures already have shadows and the double shadow effect is not desirable, and using a unlit shader causes the player shadow not to render at all.

Can someone please help me find a solution to disable shadow casting from 3d tiles while still able to receive shadows??

Solved!!!
This was really simple. After a few hours I finally realized Cesium does create MeshRenderes for each tile, I just never saw them so I assumed it was a custom rendere.

After I enabled the show tiles in heirarchy option I noticed the MeshRenderes:

Each tile has the option for “Cast Shadows” parameter:

I had to write a custom script that runs every frame that sets the Shadow Casting mode for each tile:

using CesiumForUnity;
using UnityEngine;
using UnityEngine.Rendering;

/// <summary>
/// Place this component on the CesiumGeoreference component , it will find all child rendered and sets ShadowCastingMode to "off" 
/// </summary>
[ExecuteInEditMode]
public class DisableMeshShadowcasting : MonoBehaviour
{
    void Update()
    {
        foreach (var renderer in transform.GetComponentsInChildren<MeshRenderer>())
        {
            renderer.shadowCastingMode = ShadowCastingMode.Off;
        }
    }
}

Now all tiles are no longer casting shadows but receive the character shadow! :partying_face:

Everything works wonderfully, except may I request that a toggle be added to the Cesium3DTileset component to set this parameter when instantiating the MeshRenderer? The script I wrote works but is not portable and is expensive. If it’s not too much to ask; could a option please be added? Because I believe it is essential that users have precise control of shadows for a asset as powerful as Cesium. That would be really cool! Thanks!!

Hi @vrlife,
Glad to hear you found something that works, and thank you for sharing your solution!

To make the process less expensive, you might consider subscribing to the OnTileGameObjectCreated event on the Cesium3DTileset. That should help you avoid iterating over all the components every frame.

I also wrote an enhancement request for letting users provide a template object (perhaps as a prefab) for the tile game objects: