In terms of features, pretty much WebGL is a subset of GLES2, which is a subset of modern desktop GL. Sticking to the lowest common denomination and basically writing "GLES2 without client-side rendering" gives you a good sane common ground that works across all platforms. This means not using any of the old desktop GL features such as fixed function rendering, glBegin, glVertexPointer/glColorPointer etc. Also note that the extension registryes are different for each GL, GLES and WebGL, although generally matchable. If you also want to target desktop core GL3, that's also possible, but one inconvenience there is that you need to maintain (or translate one to other - that's what I do) two sets of GLSL shader syntax. If you are working on a renderer codebase from scratch, it is best to avoid the FULL_ES2 and LEGACY_GL_EMULATION settings, which gives the best path.
Jukka On Mar 8, 2014 4:42 PM, "Michael IV" <[email protected]> wrote: > I am desktop OpenGL developer and I wonder what's the best way for me to > port or write OpenGL so that it will be best compatible with WebGL .I read > in Emscripten FAQ that using SDK included ES2 API is the besr choice.But I > also see some of the examples use regular OpenGL .For me ,in terms of > portability and usability would be best to write a normal OpenGL ,using > GLEW headers.Will it be fine as long as I use only ES2 compatible API > methods? > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
