Posts

Post not yet marked as solved
0 Replies
366 Views
The material content support many options to be loaded, two of these are NSImage (or UIImage) and SKTexture. I noticed when loading the same image file (.png) with different loaders, the material is rendered different. I'm very sure it is an extra property loaded from SpriteKit transformation, but I don't know what is it. let plane = SCNPlane(width: 1, height: 1) plane.firstMaterial?.diffuse.contents = NSColor.green let plane = SCNPlane(width: 1, height: 1) plane.firstMaterial?.diffuse.contents = NSImage(named: "texture") let plane = SCNPlane(width: 1, height: 1) plane.firstMaterial?.diffuse.contents = SKTexture(imageNamed: "texture") Code example is here: linkText - https://github.com/Maetschl/SceneKitExamples/tree/master/MaterialTests
Posted
by Maetschl.
Last updated
.