How to cast shadow on OcclusionMaterial in visionOS

I have a ModelEntity with GroundingShadowComponent

entity.enumerateHierarchy { child, stop in  
    child.components.set(GroundingShadowComponent(castsShadow: true))
}

When I set it on the table, I can see the shadow on the table, even if I disable plane detection. However, when I enable plane detection, and the plane's material is OcclusionMaterial. I can not see the shadow on the table. As far as I know, receivesDynamicLighting is not usable in VisionOS. So how can I cast shadow on OcclusionMaterial in VisionOS? Or rather, is it possible to have the shadow properly displayed on the tabletop while ensuring that I cannot see objects beneath the table through it?

There is a way to do this, but you will need to create a simple Shader Graph material instead of using the default OcclusionMaterial. There is a second version of this node called ShadowReceivingOcclusionSurface

I didn't test this with Grounding Shadows, but it works with regular dynamic light shadows.

You can find my notes on this from last year. https://stepinto.vision/labs/lab-026-using-dynamic-lights-and-shadows-with-passthrough/

How to cast shadow on OcclusionMaterial in visionOS
 
 
Q