I'm trying to use a texture to modify a SCNPlane's vertex data. As per the documentation, and the WWDC 2013 slides, one simply needs to provide a SCNMaterialProperty using -setValue:forKey: on the plane or material. This works wonderfully, but only if the material property's -contents is set to either the string/URL to an image file, or the NSImage object itself. I get the appropriately deformed mesh (I'm setting the mesh's Z value to the R channel of the input texture).
I'm trying to use my own texture data though, which is generated initially from AVFoundation with some image processing done on the CPU. I've tried to provide it as an SKTexture, constructing a MDLTexture object (and all the various classes it requires), using GLKTextureLoader, and even brute-forcing the data into a GLKTextureInfo. Loading the image using NSImage, then extracting the NSBitmapImageRep and populating the various texture classes from this also doesn't work. Metal is not an option, since I don't own recent enough hardware everywhere this needs to work.
What's the best way to get texture data into a SceneKit shader modifiers? The fact that it works for images on disk suggests to me that I'm missing something, but I can't pinpoint what. class-dump doesn't suggest any immediately obvious methods I need to call either.
Many thanks!