How to do draw 2D offscreen for texture?
I've been trying to figure this out. I've done it with opengl. But I have an orthographic projection which has a 2D drawing on it. As the 2D drawing changes, the image must be applied to the plane as a texture. However, in your example there are two 3D scenes.
Any thoughts on the best way to approach this? Maybe there's a way to just use opengl for this or maybe I have to use SpriteKit with a metal shader?
Have a look at the doRender function in the ViewController. This function renders one of the scenes into a texture offscreenTexture, the texture is obviously 2D, so all you have to do is make sure your 2D content ends up in this texture and it will appear in the other scene.
Nothing stopping you from using Metal to draw 2D objects just as you've done with OpenGL. I'd probably skip using SceneKit in the doRender function in this case (your main scene would still be scenekit based). I'm not sure if SpriteKit can render to a MTLTexture, but it'd be quite handy for this if it could. Would probably recommend against a mix of OpenGL and Metal.