【发布时间】:2020-08-20 12:28:39
【问题描述】:
纹理是否可以具有 alpha 透明度?
我有一个包含 8 位 RGBA 的 png 文件,但由于某种原因,应该是透明的部分只是黑色。
我这样分配材料:
private func setupLightMeshes(_ scene: Entity) {
let lightEntity = scene.findEntity(named: "LightWindow_Plane")!
var lightMaterial = UnlitMaterial()
lightMaterial.baseColor = try! MaterialColorParameter.texture(
TextureResource.load(named: "light.png")) // this is 8bpc RGBA
var modelComponent = lightEntity.components[ModelComponent] as! ModelComponent
modelComponent = ModelComponent(mesh: modelComponent.mesh, materials: [lightMaterial])
lightEntity.components.set(modelComponent)
}
【问题讨论】:
标签: swift augmented-reality arkit realitykit