我有托盘可以在模型上应用漫反射,金属度,法线,粗糙度和Alpha贴图,但是所有贴图都可以使用,但是只有Alpha贴图不起作用。 如何在Scenekit中制作透明玻璃?我在快速的iOS中将托盘放在下面的代码中。谁能告诉我具体的原因吗?。
if let finishMap = finish.finishMap {
if let diffuseTexturePath = finishMap.diffuseMapUrl {
disPatchGroup.enter()
self.dataProvider.fetchTextureFile(forpath: diffuseTexturePath, successBlock: { (success, imageObject) in
material.diffuse.contents = imageObject
disPatchGroup.leave()
}, failureBlock: { (error) in
disPatchGroup.leave()
})
}
if let metalTexturePath = finishMap.metalnessMapUrl {
disPatchGroup.enter()
self.dataProvider.fetchTextureFile(forpath: metalTexturePath, successBlock: { (success, imageObject) in
material.metalness.contents = imageObject
disPatchGroup.leave()
}, failureBlock: { (error) in
disPatchGroup.leave()
})
}
if let roughnessTexturePath = finishMap.roughnessMapUrl {
disPatchGroup.enter()
self.dataProvider.fetchTextureFile(forpath: roughnessTexturePath, successBlock: { (success, imageObject) in
material.roughness.contents = imageObject
disPatchGroup.leave()
}, failureBlock: { (error) in
disPatchGroup.leave()
})
}
if let normalTexturePath = finishMap.normalMapUrl {
disPatchGroup.enter()
self.dataProvider.fetchTextureFile(forpath: normalTexturePath, successBlock: { (success, imageObject) in
material.normal.contents = imageObject
disPatchGroup.leave()
}, failureBlock: { (error) in
disPatchGroup.leave()
})
}
if let transparentTexturePath = finishMap.transparentMapUrl {
disPatchGroup.enter()
self.dataProvider.fetchTextureFile(forpath: transparentTexturePath, successBlock: { (success, imageObject) in
material.transparent.contents = imageObject
disPatchGroup.leave()
}, failureBlock: { (error) in
disPatchGroup.leave()
})
}
}
答案 0 :(得分:1)
将您的透明度贴图设置为rbgZero。有几种透明度模式,我认为默认值为alpha(不确定),如果您要将灰度图像用作地图,则需要使用rgbZero
material.transparencyMode = .rgbZero