gpt4 book ai didi

ios - MDLMaterial无法正确渲染相对纹理图像

转载 作者:行者123 更新时间:2023-12-01 16:28:16 26 4
gpt4 key购买 nike

我可以将纹理图像加载并查看为SCNMaterial。如果我尝试使用同一张图片将SCNMaterial替换为MDLMaterial,则纹理无法正确呈现:

let scattering:MDLPhysicallyPlausibleScatteringFunction = MDLPhysicallyPlausibleScatteringFunction()
scattering.baseColor.textureSamplerValue = MDLTextureSampler()
scattering.baseColor.textureSamplerValue?.texture = MDLTexture(named: "art.scnassets/metal_bumpy_squares_Base_Color.png")

let mdlMaterial = MDLMaterial(name: "cube", scatteringFunction: scattering)
let node = SCNNode(geometry: SCNSphere(radius: 1))
node.geometry?.firstMaterial = SCNMaterial(MDLMaterial: mdlMaterial)
// With SCNMaterial works as expected
// node.geometry?.firstMaterial = SCNMaterial()
// node.geometry?.firstMaterial?.diffuse.contents = "art.scnassets/metal_bumpy_squares_Base_Color.png"
// node.position = SCNVector3Make(0,0,-3)

是否需要其他设置才能正确渲染图像?

最佳答案

并非模型I / O可以表示的所有内容都在SceneKit中可用。例如,基于物理的渲染是不支持的功能之一。

关于ios - MDLMaterial无法正确渲染相对纹理图像,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33918324/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com