I am looking to transition my project from OpenGLES to Metal, and am wondering if there is a way to convert the .vsh and .fsh files for use with Metal. I have seen posts which suggest that this is possible, but have difficulty understanding how to do it. I am looking for answers or techniques which use either Objective-C or Swift (the existing code is Objective-C, but the rest of the project has been converted to Swift 5).
There isn’t a direct way to convert .vsh and .fsh files for use with Metal, but you can use a tool like MetalShaderConverter which is provided by Apple. This tool can convert OpenGL ES shaders to Metal shaders and is included with Xcode. You can also manually rewrite the shaders to work with Metal. The video by name covers the fundamentals of programming with shaders and includes a GitHub demo project.