OpenGL ES 3.1 - how to enable ?

So, since Gear VR works only with GL ES 3.1 devices, I wonder why is 4.10.1 comes with GL ES 3.1 disabled, even when deploying for Gear VR ?

Is there a way to enable GL ES 3.1 without recompiling engine from the source ?

@Epic: Could you please enable GL ES 3.1 when deploying for Gear VR, without a need in recompiling source code ?

GearVR works fine with ES2. I could not get ES 3.1 working on the GearVR(compiled from 4.10.1 source), the app simply closed(didn’t check the log). But it was just for a test anyway. Currently all major GearVR games with UE4 or Unity use ES2(Gunjack, Anshar Wars, Land’s end). ES 3.1 is only suitable if you want to use the deferred rendering path, wich i assume is a bit too heavy for the GearVR.

However, Oculus and Unity recommend using GL ES 3.1 and forward rendering, even though Unity also can use GL ES 2.x. I also recall ASTC compression is only usable with GL ES 3.1 render target and capable hardware, which is what S6 and alike provide.

We are also looking to switch to ES3.1 for GearVR. Doing so would fix a bunch of material compile issues as well as give us the option to use instancing to reduce draw call count which is killing performance at the moment. However, it seems there are a number of NVidia extensions that its looking for as well as a couple more extensions that are not supported so the code falls back to ES2.

LogRHI:Warning: Entering FPlatformOpenGLDevice::Init
LogRHI:Warning: Failed to find entry point for glGetTextureHandleNV
LogRHI:Warning: Failed to find entry point for glGetTextureSamplerHandleNV
LogRHI:Warning: Failed to find entry point for glMakeTextureHandleResidentNV
LogRHI:Warning: Failed to find entry point for glUniformHandleui64NV
LogRHI:Warning: Failed to find entry point for glMakeTextureHandleNonResidentNV
LogRHI:Warning: Failed to acquire all optional OpenGL entrypoints, may fall back to OpenGL ES 2.0

Then it crashes because the cook process only cooked the ES3.1 version of the GlobalShader Cache but is looking for the ES2 cache.
Fatal error: [File:D:\Develop\xxxxx\root\UE4\Engine\Source\Runtime\Engine\Private\GlobalShader.cpp] [Line: 408]
The global shader cache file ‘…/…/…/Engine/GlobalShaderCache-GLSL_ES2.bin’ is missing.
Your application is built to load COOKED content. No COOKED content was found; This usually means you did not cook content for this build.
It also may indicate missing cooked data for a shader platform(e.g., OpenGL under Windows): Make sure your platform’s packaging settings include this Targeted RHI.
Alternatively build and run the UNCOOKED version instead.
[2016.04.05-15.00.51:574] 0]Assertion failed: Assertion failed: [File:D:\Develop\xxxxx\root\UE4\Engine\Source\Runtime\Engine\Private\GlobalShader.cpp] [Line: 408]
The global shader cache file ‘…/…/…/Engine/GlobalShaderCache-GLSL_ES2.bin’ is missing.
Your application is built to load COOKED content. No COOKED content was found; This usually means you did not cook content for this build.
It also may indicate missing cooked data for a shader platform(e.g., OpenGL under Windows): Make sure your platform’s packaging settings include this Targeted RHI.
Alternatively build and run the UNCOOKED version instead.

Are there any plans to have this supported for GearVR? Also, the new instanced stereo rendering done for Oculus in 4.11, will that be supported on GearVR any time soon?

Per Oculus, there are no plans (that they know of) for GLES 3.1 support for GEar VR in UE4 since Epic chose to pursue Vulkan API.

Do you have the reference that says there will be no support?

In case somebody wonders, GL ES 3.1 is not needed for instancing support (at least as of UE 4.11). ES2 backend automatically detects if device supports hardware instancing (basically OpenGL ES 3.0) and if so, activates it. Otherwise instanced meshes are rendered in batches. :slight_smile: