I'm trying to draw an Earth, as I've found the textures in this site: http://planetpixelemporium.com/earth.html
I loaded the diffuse, specular and bump maps:
let earthGeometry = SCNSphere(radius: radius)
let earthMap = UIImage(named: "Earth_map")
let earthBump = UIImage(named: "Earth_bump")
let earthSpec = UIImage(named: "Earth_specular")
earthGeometry.firstMaterial!.diffuse.contents = earthMap
earthGeometry.firstMaterial!.specular.contents = earthSpec
let earth = SCNNode(geometry: earthGeometry)
But there is no property for the bump map. The only way that comes to my mind is to use a MDLMaterial but I see no way to convert the material back to a SCNMaterial. The method:
+ (instancetype)materialWithMDLMaterial:(MDLMaterial *)mdlMaterial
Runs just in Objective-C and not in Swift. Does anyone know how to convert it to a SCNMaterial, or alternatively to use another way to apply a bump map in a SCNMaterial?