Support GLES3 in engine

Awesome! I only implemented bare minimal functionality i needed. Thanks for finally finishing it properly :+1:

hey rku, can we know the name of the game?

Planetoid Escape is also a fairly big project, which I’m planning to eventually commercialize (hopefully sometimes next year), so that could count as commercial project under development using Urho.

I’m also interested in GLES3 mostly for Oculus Quest. For puzzle type games for the mobile market I’d probably stick to GLES2 to maximize compatibility.

Im now release my old game “Brick Break” - Andriod mobile game on GLES3. The game has a lot of small identical elements in the frame, and without instancing it is difficult to make it.

I updated my post with a link.

2 Likes

I have requested help in our GitHub issue tracker but I have not getting the help I need. The original PR seems to break the Web platform, all the samples have runtime error and just displaying blank canvas. I need help from others to confirm my observation because my local test branch is not clean and it could be my own doing, and also help to fix the issue if it is indeed a regression issue.

1 Like

@orefkov

I kicked off a build before I left for work this morning, I will let you know how it goes tonight.

2 Likes

I got it working again. I have to revert back one line of change from the PR to what it was before.

diff --git a/bin/CoreData/Shaders/GLSL/Uniforms.glsl b/bin/CoreData/Shaders/GLSL/Uniforms.glsl
index b823be7f84..2ee0bcaafd 100644
--- a/bin/CoreData/Shaders/GLSL/Uniforms.glsl
+++ b/bin/CoreData/Shaders/GLSL/Uniforms.glsl
@@ -48,7 +48,7 @@ uniform mat4 cZone;
 #ifdef COMPILEPS
 
 // Fragment shader uniforms
-#ifdef MOBILE_GRAPHICS
+#ifdef GL_ES
     precision mediump float;
 #endif

Still, I become not that confident with all the proposed changes as the result. i.e. I think we need more eyeballs to validate this PR.

1 Like

Let me know if my approach is wrong. As I understand the GLES 3 is more or less equivalent to WebGL 2. So, in my test branch I have added (experimental) build option to enable WebGL 2 for Web build. It builds cleanly now but runtime still gives error. I intend to “fix” the current GLES 3 implementation by fixing the runtime errors from WebGL2 build that I observed. Hopefully I do not cause further regression issue to GLES 3 on other platforms in the process. This is far beyond my comfort zone.

3 Likes

I built the orefkov_GLES3_Support branch both with EMSCRIPTEN_WEBGL2 and without, and with the fix to change MOBILE_GRAPHICS to GL_ES in Uniforms.glsl, I have no runtime errors. Without that change, I get runtime errors on both builds. GraphicsDefs.h considers WebGL to be a Desktop platform instead of a mobile platform and MOBILE_GRAPHICS isn’t being set for WebGL builds, so no float precision is being specified unless, as your recent commit does, the float precision specifier is based on GL_ES instead of MOBILE_GRAPHICS.

3 Likes

I totally agree with your conclusion. For Web platform, I think it is also difficult to draw the line between DESKTOP_GRAPHICS and MOBILE_GRAPHICS. The same WebGL/2 API might have slightly different implementation between mobile browser and desktop browser, for example.

2 Likes

Hi folks. I refresh my PR for work with last Urho3D master branch.
Fix emscripten builds, and now Android and Web can work on GLES2 and GLES3 without errors.
Im extend 06_SkeletalAnimation sample - on GLES3 it run with deffered render path and has many lights.
UPD: My PR merged.

Worked in Android with GLES2


And worked in Android GLES3

WebGL1, GLES2 Debug UI

WebGL2, GLES3

WebGL2, GLES3, Debug UI

Builded Android version with examples - https://disk.yandex.ru/d/tmCFD11dnnmogQ

5 Likes

lol. You merge it now that Urho has gone clown world?

A software product cannot “gone clown world”. Those who expose themselves to ridicule go to the clown world. Your showdowns are not interesting to me, I just do my job and share it with people.

1 Like

But I just followed your recommendation