This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

OpenGL ES 3.0 Context

Note: This was originally posted on 26th April 2013 at http://forums.arm.com

Hi,
I would like to know how to create a proper OpenGL ES 3.0 Context with OpenGL ES 3.0 Emulator
The only example that came with it only use OpenGL ES 2.0 context, and according to the User Guide i need to use EGL_RENDERABLE_TYPE,EGL_OPENGL_ES3_BIT attributes and EGL_CONTEXT_CLIENT_VERSION,3 contextattributes

BUT, apparently EGL_OPENGL_ES3_BIT (nor EGL_OPENGL_ES3_BIT_KHR) is not defined anywhere, so i wonder if OpenGL ES 3.0 Emulator really support ES 3.0 ?

Also, what is the best way to make a 3D program that can fallback to ES 2.0 when ES 3.0 is not supported without building a different program for each of them (and if possible to fallback to ES 1.x if Es 2.0 is not supported also)?
Do i need to use EGL_RENDERABLE_TYPE,(EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT | EGL_OPENGL_ES3_BIT) for multiple ES support? any example how to use it? (so player can change between 3.0, 2.0 and 1.x on the fly)
Of course each of them will have a different rendering engine where ES 3.0 will use more advanced visual effect, i just need the example on creating ES 3.0,ES 2.0 and ES 1.x Context (all 3 of them using fallback method) within a single source code (if it's possible)


Thanks in advance
  • Note: This was originally posted on 3rd May 2013 at http://forums.arm.com

    Hi Adam,

    I have spoken to some of my colleagues that work on the OpenGL ES 3.0 Emulator and you are correct the EGL_OPENGL_ES3_BIT is not defined anywhere and this will be fixed in a later release. However the emulator does define EGL_OPENGL_ES3_BIT_KHR. This can be located in the eglext.h header file.

    I have spoken to my colleagues about what the best way to fallback on the most appropriate OpenGL ES version and we believe the best idea is to do it in stages. First look for configurations that support (EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR) and if a desired one can't be found move down to EGL_OPENGL_ES2_BIT and so on. We don't believe you can try all three at the same time (EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT | EGL_OPENGL_ES3_BIT_KHR) because we think only configurations that support all 3 will be shown. There is no sample code yet showing you how to do this but we are working to release some soon.

    Hope this helps,
    Stephen
  • Note: This was originally posted on 3rd May 2013 at http://forums.arm.com


    Hi Adam,

    I have spoken to some of my colleagues that work on the OpenGL ES 3.0 Emulator and you are correct the EGL_OPENGL_ES3_BIT is not defined anywhere and this will be fixed in a later release. However the emulator does define EGL_OPENGL_ES3_BIT_KHR. This can be located in the eglext.h header file.

    I have spoken to my colleagues about what the best way to fallback on the most appropriate OpenGL ES version and we believe the best idea is to do it in stages. First look for configurations that support (EGL_RENDERABLE_TYPE, EGL_OPENGL_ES3_BIT_KHR) and if a desired one can't be found move down to EGL_OPENGL_ES2_BIT and so on. We don't believe you can try all three at the same time (EGL_RENDERABLE_TYPE, EGL_OPENGL_ES_BIT | EGL_OPENGL_ES2_BIT | EGL_OPENGL_ES3_BIT_KHR) because we think only configurations that support all 3 will be shown. There is no sample code yet showing you how to do this but we are working to release some soon.

    Hope this helps,
    Stephen


    Hi Stephen,
    Thank for the info, i forgot to check the eglext.h :)

    Currently i manage to implement fallbacks on the cube example and it works, but my implementation is kinda feels odd, because it seems that EGL_RENDERABLE_TYPE didn't really used for choosing ES version.
    The only thing that makes different is the EGL_CONTEXT_CLIENT_VERSION, i can use 1,2 or 3 for contextattributes regardless of what ever EGL_RENDERABLE_TYPE i use for attributes.

    For example, i use EGL_RENDERABLE_TYPE,EGL_OPENGL_ES_BIT with EGL_CONTEXT_CLIENT_VERSION,3 the program still runs properly(using ES 3.x) without getting any error, which is kinda odd i think. (EGL_RENDERABLE_TYPE,EGL_OPENGL_ES2_BIT with EGL_CONTEXT_CLIENT_VERSION,1 also works and uses ES 1.x)

    So currently my fallback stages implementation is by checking the eglCreateContext result and fallback(by changing the EGL_CONTEXT_CLIENT_VERSION and re-try the eglCreateContext) instead of checking the eglChooseConfig result.
    Not sure whether my implementation will works globally on various devices (including non-Mali devices) or not.


    PS: Another issue is, it seems that EGL.DLL that came with OpenGL ES 3.0 Emulator v1.1 refuses to run if the video card doesn't support ES 3.0 (ie. my Intel HDGraphics 3000 which only support OpenGL 3.1) even when i'm only using ES 1.x functions/features, so i can only test my implementation on my Geforce 610M which support OpenGL 4.3, making a fallback implementation useless if the EGL.DLL it self need a ES3-compatible GPU.
    If only OpenGL extensions were loaded after ES version chosen (ie. after eglChooseConfig/eglBindAPI/eglCreateContext called)
  • Note: This was originally posted on 13th May 2013 at http://forums.arm.com

    Hi Adam,

    Although you are correct you can just give an EGL_CONTEXT_CLIENT_VERSION 1,2 or 3 we don't recommend doing it this way. This is because it is not guaranteed to work with all hardware platforms and GPU's. It will all depend on how a particular hardware vendor has chosen to implement the spec. So in this case although for the emulator and some hardware platforms it works by just passing EGL_CONTEXT_CLIENT_VERSION we strongly recommend you also pick a surface with the correct EGL_RENDERABLE_TYPE as well.

    As for your issue with the emulator not supporting older graphics cards. You are correct currently the OpenGL ES 3.0 emulator will only run on cards that support OpenGL 3.2 and above. Also the OpenGL ES 3.0 emulator at present will not support OpenGL ES 1.0. I recommend for your Intel HD Graphics 3000 computers you switch to a separate product called the OpenGL ES 2.0 emulator. Here is the link to it on the website.

    This product only requires OpenGL 2.0 to be supported in order to work. I know that this isn't an ideal solution as OpenGL ES 3.0 will not be supported but you would have issues with your Intel HD Graphics 3000 GPU anyway.

    Hope this helps,
    Stephen
  • Note: This was originally posted on 14th May 2013 at http://forums.arm.com


    Hi Adam,

    Although you are correct you can just give an EGL_CONTEXT_CLIENT_VERSION 1,2 or 3 we don't recommend doing it this way. This is because it is not guaranteed to work with all hardware platforms and GPU's. It will all depend on how a particular hardware vendor has chosen to implement the spec. So in this case although for the emulator and some hardware platforms it works by just passing EGL_CONTEXT_CLIENT_VERSION we strongly recommend you also pick a surface with the correct EGL_RENDERABLE_TYPE as well.

    As for your issue with the emulator not supporting older graphics cards. You are correct currently the OpenGL ES 3.0 emulator will only run on cards that support OpenGL 3.2 and above. Also the OpenGL ES 3.0 emulator at present will not support OpenGL ES 1.0. I recommend for your Intel HD Graphics 3000 computers you switch to a separate product called the OpenGL ES 2.0 emulator. Here is the link to it on the website.

    This product only requires OpenGL 2.0 to be supported in order to work. I know that this isn't an ideal solution as OpenGL ES 3.0 will not be supported but you would have issues with your Intel HD Graphics 3000 GPU anyway.

    Hope this helps,
    Stephen


    Hi,
    Yes, i realized that it's probably vendor specific, so i modified my fallback code again.

    I already have OpenGL ES (1.x-2.x) Emulator and ES 3.0 Emulator installed, the LIBEGL.DLL and include files for ES 3.x(also for 2.x) i used are from ES 3.0 Emulator, while the include files for ES 1.x i used are from ES (1.x-2.x) Emulator, and combining both of them for fallback implementation seems to works just fine so far (with Geforce 610M, and i only tested them on my modified cube example). And when i checked my EXE Dependencies it seems only LIBEGL.DLL that being used in my EXE file while the rest of GL calls are from OpenGL32.DLL(through LIBEGL.DLL), so i wonder whether GLES*.DLL(s) are really needed or not (i was hoping it used GLES*.DLL through LIBEGL.DLL instead of directly to OpenGL32.DLL from LIBEGL.DLL, but apparently it's not)

    As i remember the LIBEGL.DLL that came with OpenGL ES 3.0 Emulator v1.0 worked with Intel HD3000, but after upgrading to v1.1 it's no longer works with HD3000.