I'm looking for an example of a billboard texture shader that I can use with SceneKit.
I have a landscape of tiny red dots that I need to render. The dots all need to face the camera head-on.
Using SceneKit, I've managed to render the landscape's geometry and I've made a pattern texture for the dots. This looks roughly like the desired output, however, the dots shouldn't be skewed along the contours of the landscape they should all look face onto the camera and be a perfect circle when viewed from any angle.
At the moment they look like this...
But the effect should be along the lines of this...
I've reached out to Apple and they have suggested writing a billboard shader in Metal and plugging that into my SceneKit code as an SCNProgram.
That's a daunting task though so if anyone's done anything similar before it would be very helpful to see the code.