I want to use SCNTechnique to make many SCNNodes (angle joint Gizmos) with a assigned categoryBitmask draw on top of other SCNNodes. I used the exact approach by Simeon on this SO thread (see Gizmo.metal) to make it work with one SCNNode but I need many but the modifications I make to the plist don't work. This is what I tried adding under pass_gizmo (see plist by Simeon at the "this" link above):
<key>includesCategoryMask</key>
<integer>2</integer>
<key>excludesCategoryMask</key>
<integer>0</integer>
<key>inputs</key>
I understand that scene can only carry one SCNTechnique at one time and so using the node name approach wouldn't work for more than one SCNNode.
Gizmo.metal and the plist (named scntec) is added to the game template Xcode project. GameViewController is a SCNSceneRendererDelegate. Link to Apples documentation.
This is the code to load the plist in viewDidLoad:
// retrieve the SCNView
let scnView = self.view as! SCNView
scnView.delegate = self
// set the scene to the view
scnView.scene = scene
if let path = Bundle.main.path(forResource: "scntec", ofType: "plist"), let dict = NSDictionary(contentsOfFile: path)
{
let technique = SCNTechnique(dictionary: dict as! [String : AnyObject])
scnView.technique = technique
}
Did you add the following to your render pass:
This draws the whole scene with all the nodes that correspond to the category bit masks you specified.