gl4es icon indicating copy to clipboard operation
gl4es copied to clipboard

drop in frame rate when the grass instancing function is enabled.

Open pulion opened this issue 4 years ago • 25 comments

First of all, I want to thank the gl4es developers for the opportunity to play via OpenMW in Morrowind. there was a performance problem when the grass instancing mode was enabled, namely, its strong fall and the load on the GPU. I am sure that with the right approach, grass instancing will work, if not better, then definitely not worse than grass paging. for example, here are three screenshots using different technologies for rendering grass: grass paging, grass instancing and a simple modular grass connection without using the above technologies. I really hope that you can fix the gl4es code and it will improve the performance on Android devices. Grass paging Screenshot_20210301-163336745

Grass instancing Screenshot_20210301-163751168

Module grass Screenshot_20210301-164043016

pulion avatar Mar 01 '21 16:03 pulion

Well, "Instancing" is not supported on hardware yet with gl4es. I know what I have to do for that, but I need to do it. I'll try to it soon enough, but I need to check if I can enable that with GLES2 with extension first. I don't plan to use GLES3 yet, as it's even more changes.

ptitSeb avatar Mar 01 '21 16:03 ptitSeb

Well, "Instancing" is not supported on hardware yet with gl4es. I know what I have to do for that, but I need to do it. I'll try to it soon enough, but I need to check if I can enable that with GLES2 with extension first. I don't plan to use GLES3 yet, as it's even more changes.

I really hope that in your busy schedule there is a minute that you can devote to Android players. the huge Russian-speaking OpenMW android community will be very grateful to you if you can solve the problem with this drop in performance. thanks for the answer.

pulion avatar Mar 01 '21 16:03 pulion

This says: "Geometry instancing is available from OpenGL ES 3.0 and to OpenGL 2.0 devices which support the GL_NV_draw_instanced or GL_EXT_draw_instanced extensions."

AbduSharif avatar Mar 01 '21 16:03 AbduSharif

Also grass instancing is supposed to make use of the GPU (unlike paging) so even if gl4es optimized the way it's handling it keep in mind that it's much better to use a lower density to preserve performance, especially if you're using shaders and other heavy mods on the GPU.

AbduSharif avatar Mar 01 '21 16:03 AbduSharif

I built two APKs to test this. "instancing" - my video card is loaded at 100% and this gives 28 fps, with the same "Paging" settings - 50 fps with the same load on the hardware.

docent27 avatar Mar 01 '21 16:03 docent27

I used the same settings in my tests, including grass density, apart from modular grass connection. I'm not an expert in this area, but it seems to me that it is possible to unload the GPU by directing some of the load to the CPU. After all, the CPU, as you can see from the screenshots, is idle.

pulion avatar Mar 01 '21 16:03 pulion

Can you check that your hardware support GL_EXT_draw_instanced extension in GLES2? I'll probably try to use that one when I'll implement hardware support for instancing.

ptitSeb avatar Mar 01 '21 16:03 ptitSeb

Can you check that your hardware support GL_EXT_draw_instanced extension in GLES2? I'll probably try to use that one when I'll implement hardware support for instancing.

I unfortunately do not know how to check it. can you tell me how to do this? I run tests on two smartphones: Asus ROG phone 3 and poco f2 pro. in the screenshots I am using Asus ROG phone 3.

pulion avatar Mar 01 '21 17:03 pulion

I'm sorry, but I don't know how to check this. I only know that my phone has a Snapdragon 835 processor

docent27 avatar Mar 01 '21 17:03 docent27

There's an app called OpenGL ES extensions, it will show extensions supported by the device for both OpenGL and Vulkan.

AbduSharif avatar Mar 01 '21 17:03 AbduSharif

I have this on my device for example: https://www.khronos.org/registry/OpenGL/extensions/OES/OES_draw_elements_base_vertex.txt

Both OES and EXT

Eitherway most hardware nowadays has OpenGL ES 3 so it should be supported by the GPU.

AbduSharif avatar Mar 01 '21 17:03 AbduSharif

Can you check that your hardware support GL_EXT_draw_instanced extension in GLES2? I'll probably try to use that one when I'll implement hardware support for instancing.

No... GL_EXT_draw_buffers_indexed only...

docent27 avatar Mar 01 '21 17:03 docent27

in which section can I see information about this? Screenshot_20210301-191057816

pulion avatar Mar 01 '21 17:03 pulion

in which section can I see information about this? Yes, I looked in this program. I have not found such a line in the list of available extensions.

docent27 avatar Mar 01 '21 17:03 docent27

Look at the link I provided if you have a draw elements extension or your device supports OpenGL ES 3 it should work.

AbduSharif avatar Mar 01 '21 17:03 AbduSharif

There is no limit to my disappointment. I have not found such a line in "OpenGL Extensions"

docent27 avatar Mar 01 '21 17:03 docent27

Mmmm, so the GLES2 extension is pretty rare :( And GLES3 is a lot of work. So, not sure how I will progress in this. Anyway, I have a few regression to fix on gl4es first, so I'll probably fix that, and start working on new stuff (like sRGB or Instancing) on next dev. cycle.

ptitSeb avatar Mar 01 '21 17:03 ptitSeb

Can you check that your hardware support GL_EXT_draw_instanced extension in GLES2? I'll probably try to use that one when I'll implement hardware support for instancing.

there's no such thing.

pulion avatar Mar 01 '21 17:03 pulion

Mmmm, so the GLES2 extension is pretty rare :( And GLES3 is a lot of work. So, not sure how I will progress in this. Anyway, I have a few regression to fix on gl4es first, so I'll probably fix that, and start working on new stuff (like sRGB or Instancing) on next dev. cycle.

Thanks for the continued support on this.

AbduSharif avatar Mar 01 '21 17:03 AbduSharif

Mmmm, so the GLES2 extension is pretty rare :( And GLES3 is a lot of work. So, not sure how I will progress in this. Anyway, I have a few regression to fix on gl4es first, so I'll probably fix that, and start working on new stuff (like sRGB or Instancing) on next dev. cycle.

thanks for the support of the android community.

pulion avatar Mar 01 '21 18:03 pulion

Mmmm, so the GLES2 extension is pretty rare :( And GLES3 is a lot of work. So, not sure how I will progress in this. Anyway, I have a few regression to fix on gl4es first, so I'll probably fix that, and start working on new stuff (like sRGB or Instancing) on next dev. cycle.

We will be very grateful to you! Thanks for the support!

docent27 avatar Mar 01 '21 18:03 docent27

Seems like new xclipse 920 mobile gpu support angle_instanced_arrays extension, can it be used to bring gl_draw_instanced emulation?

https://www.khronos.org/registry/OpenGL/extensions/ANGLE/ANGLE_instanced_arrays.txt

Also gl_ext_instanced_arrays

Sisah2 avatar Apr 27 '22 18:04 Sisah2

This extension does the same, it has been there for a long while: GL_EXT_draw_instanced

AbduSharif avatar Apr 27 '22 19:04 AbduSharif

But none of my phones supported it.

Sisah2 avatar Apr 27 '22 20:04 Sisah2

It's supported in mine :)

AbduSharif avatar Apr 28 '22 00:04 AbduSharif