All Projects → laanlabs → SCNTechniqueGlow

laanlabs / SCNTechniqueGlow

Licence: MIT License
Basic object glowing outline using SCNTechnique

Programming Languages

swift
15916 projects
Metal
113 projects

SCNTechniqueGlow

Very basic example of drawing a glow outline around a SceneKit node. Uses SCNTechnique with Metal shaders.

Code quality not guaranteed.

Based on / inspired by these nice SCNTechnique examples. https://github.com/lachlanhurst/SCNTechniqueTest https://github.com/kosua20/Technique-iOS

ARKit Usage

Update Main.storyboard to launch ViewController to view the ARSCNView demo.

FAQ

How do I make the blur larger?

For now you will have to manually add blur passes in NodeTechnique.plist. Check the 'sequence' key. This is where the blur passes are defined. Each blur stage requires two blur passes: a horizontal + vertical pass. So make sure to add 'pass_blur_h' along with 'pass_blur_v' or you will end up with an uneven glow.

How do I change the blur color?

You can pass the color from swift into the metal shader when setting up the technique here. It should look something like this:

let color = SCNVector3(1.0, 1.0, 0.0)
technique.setValue(NSValue(scnVector3: color), forKeyPath: "glowColorSymbol")

Author

This project was created by Laan Labs. We design and build solutions at the intersection of Computer Vision and Augmented Reality.

http://labs.laan.com

@laanlabs

License

SCNTechniqueGlow is released under the MIT License. See LICENSE for details.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].