As for the GL problems: * VBO's don't seem to work for some reason (I just get garbage geometry) >
I have VBOs working without problems, but I don't use the glMapBuffer emulation since those calls don't exist in WebGL. I'm not sure how well the glMapBuffer emulation has been tested. If your code uses the map-buffer calls it might be worth it to rewrite them to glBufferSubData (and manually double buffered vertex buffers, buffer-orphaning doesn't make sense in WebGL) > * glVertexAttribPointer and friends don't seem to work > Again, glVertexAttribPointer didn't cause problems for me. I'm using them in 'vertex buffer mode', where the last parameter is an offset, not a pointer. See here: https://github.com/floooh/oryol/blob/master/code/Modules/Gfx/gl/glRenderer.cc#L379 > * glUniformMatrix4fv doesn't appear to work > I'm using this also without problem, see here: https://github.com/floooh/oryol/blob/master/code/Modules/Gfx/gl/glRenderer.cc#L1136 > * glEnable(GL_ALPHA_TEST); does not give alpha testing with fixed-function > (can be emulated in shaders though). > I think GL_ALPHA_TEST is not support in GLES2/WebGL, should be done in the frament shader > * only seem to get one working glDrawArrays or glDrawElements call per VBO > or vertex-array. > Works fine for me (with VBOs, haven't tested old-school vertex arrays). > * glTexParameterf and similar can't update integer parameters (generally > works on desktop GL) > Shouldn't this be glTexParameteri(), not glTexParameterf()? I'm using those to set sampler parameters: https://github.com/floooh/oryol/blob/master/code/Modules/Gfx/gl/glTextureFactory.cc > * texture filtering options don't work correctly > ** some textures which should be drawn using mipmapped nearest filtering > are drawn using trilinear. > * in some cases, code within the GL wrapper seems to give "type error" and > "value must be an integer" type exceptions. > Haven't seen those problems yet. In general, WebGL is still only GLES2, so you should use a 'WebGL friendly subset of desktop GL', otherwise you'll see performance problems in the best case and GL wrapper bugs in the worst case ;) My samples here use a lot of basic GL features (and have triggered quite a few WebGL bugs in different browsers over time): http://floooh.github.io/oryol/ Together with the GL rendering code (https://github.com/floooh/oryol/tree/master/code/Modules/Gfx/gl) it should give you a good 'verification base' to check which GL features are guraranteed to work, or which areas might be 'here be dragons' territory ;) Cheers, -Floh. -- 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.
