3

I have a SceneKit/ARKit App with all textures images stored in an Asset catalog as Texture Sets. For texturing my materials, I am setting the material.diffuse.content property to the name (as String) of the desired Texture Set, and everything works perfectly.

However, I would also like to load the texture from the Asset catalog as an Image (or MDLTexture, or MTLTexture). The only access method I found in the docs for the Asset Catalog is UIImage(name: "my_name") which works for an Image Set only (at least in my tests).

I also found a way to solve my problem using the MetalKit MTKTextureLoader, thanks to this answer: https://stackoverflow.com/a/51202156/5447024 .

But I suspect I am missing some more direct way to do it with SceneKit.

Any help appreciated.

user16217248
  • 3,119
  • 19
  • 19
  • 37
ggmorga
  • 61
  • 5
  • Especially as there is no MetalKit on WatchOS, it would be interesting, how to load sth. like a cube texture set from the asset catalog.... – 1024kilobyte Oct 23 '20 at 21:58

0 Answers0