This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
A CIFilter that uses a Metal function that converts a black pixel (or almost black) to a transparent pixel. | |
*/ | |
class BLKTransparent: CIFilter { | |
private var kernel: CIColorKernel | |
var inputImage: CIImage? | |
var threshold: Float? | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import SceneKit | |
// Set up a SceneKit view | |
let view = SCNView(frame: CGRect(x: 0, y: 0, width: 300, height: 300)) | |
view.autoenablesDefaultLighting = true | |
view.scene = SCNScene() | |
let root = view.scene!.rootNode | |
// Display it live | |
import XCPlayground |