RealityKit –以编程方式将材料添加到ModelEntity

问题描述:

RealityKit的文档包括以下结构:OcclusionMaterialSimpleMaterialUnlitMaterial用于向ModelEntity添加材料.

The docs for RealityKit include the structs: OcclusionMaterial, SimpleMaterial, and UnlitMaterial for adding materials to a ModelEntity.

或者,您可以在模型中加载带有附加材料的模型.

Alternatively you can load in a model with a material attached to it.

我想以编程方式向ModelEntity添加自定义材料/纹理.如何在不向Reality Composer或其他3D软件的模型中添加材料的情况下即时实现这一目标?

I want to add a custom material/texture to a ModelEntity programmatically. How can I achieve this on the fly without adding the material to a model in Reality Composer or some other 3D software?

更新时间:2020年6月23日.

目前RealityKit 2.0中有4种类型的材料: