应用程序崩溃设置SceneKit iOS中的纹理置换

时间:2018-03-26 11:31:38

标签: ios xcode scenekit texture-mapping

我可以通过SceneKit编辑器设置纹理/材质的位移,但是当我通过这样的代码设置它时,它会崩溃我的应用程序。

material.displacement.contents = "displacement.png"
material.displacement.contentsTransform = SCNMatrix4MakeScale(10, 10, 0)
material.displacement.wrapT = .repeat
material.displacement.wrapS = .repeat

如果我对此行material.displacement.contentsTransform = SCNMatrix4MakeScale(10, 10, 0)发表评论,那么它可以完美运行,但在这种情况下它不会耕作/重复。

enter image description here

崩溃日志:validateFunctionArguments:3341:断言失败`顶点函数(commonprofile_vert):来自缓冲区(3)的参数scn_commonprofile [0],偏移量(0)和长度(608)的空间为608 bytes,但参数的长度为(672)。'

1 个答案:

答案 0 :(得分:1)

当我使用.obj文件时,我遇到了这个问题。当切换到从3DSMax导出的DAE文件时,应用程序不再崩溃,我能够在我的材料上正确设置置换贴图。

看起来SceneKit有一些bug .obj bug。我只使用DAE文件为自己节省了很多麻烦。

相关问题