SceneKit pass uniform vector to shader modifiers

情到浓时终转凉″ 提交于 2019-12-05 10:02:46

So you have to use NSValue, that has a convenience initialization for SCNVector4, so:

let v = SCNVector4(x: 250.0, y: 0.0, z: 0.0, w: 0.0)
material.setValue(NSValue(scnVector4: v), "colorOffset")

It'd be too good if SceneKit could handle it's own types directly...

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!