RealityKit–如何为自然光创建阴影捕捉器



我想创建一个平面:

func getShadowPlane(_ width: Float, _ height: Float) -> ModelEntity {
let sphereResource = MeshResource.generatePlane(width: width, 
depth: height)
let myMaterial = ShadowMataerial . ????
return ModelEntity(mesh: sphereResource, materials: [myMaterial])
}

&把它添加到我的特定位置的锚上。我想从";照明";我从我的相机中了解到RealityKit能够捕捉/生成。

我不想使用

AnchorEntity(plane: AnchoringComponent.Target.Alignment.horizontal)

你知道怎样才能做到这一点吗?

我找不到shadowCatcher材料。

恐怕RealityKit 2.0中没有只捕捉阴影的公式,比如SceneKit的:

SCNMaterial().lightingModel = .shadowOnly

但是,您可以使用基于.png图像的"假阴影",也可以实现"金属"来单独捕捉阴影。

最新更新