I would like to implement a transparent material that both receives shadows and can be occluded. I understand that when using the AR/Basic Occlusion
shader provided by the PolySpatial package, it is mapped to Apple’s OcclusionMaterial
during build, but this does not seem to receive shadows, as shadows from objects with the VisionOSGroundingShadow
component are not cast on it. I am aiming to create a material equivalent to RealityKit’s Shadow Receiving Occlusion Surface, but is there a way to achieve this with the current PolySpatial?
I tried adding support for that a while back (when someone asked about support for the receivesDynamicLighting option for OcclusionMaterial, which, as that page shows, is not supported on visionOS), and ran into a runtime error when trying to load the shader that suggested that it also wasn’t supported on visionOS. I just tried again, and got an “invalidTypeFound” exception on the simulator (without any additional information) when I tried to use the material type (ND_realitykit_shadowreceiver_surfaceshader). It’s interesting that this doesn’t happen in Reality Composer Pro, though, and I haven’t tried it on device.
I’m not aware of any other way to achieve the desired effect.
1 Like