I’m writing an application that should run both on WebGL1 and on desktop with OpenGL. I’ve got a library that abstracts over the GL API, but now I need to figure out if I can avoid writing the shaders twice, one for web and one for desktop.
I was in great shape working with WebGL2 until I realized that Safari doesn’t support WebGL2 and that makes up a good 16% or so of the global market according to CanIUse.com.
Unfortunately I want this to work on iPhones so now I need to rewrite my shaders for #version 100
of GLSL. My question is, with GLSL 1.00 shaders work on Desktop using OpenGL 3.3 or is there any tools that can cross-compile my shader to both GLES 3.00 and GLSL 1.00?