Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WebGL] Support for Uniform Buffer Objects #1365

Open
QuantumCoderQC opened this issue Sep 20, 2021 · 8 comments
Open

[WebGL] Support for Uniform Buffer Objects #1365

QuantumCoderQC opened this issue Sep 20, 2021 · 8 comments

Comments

@QuantumCoderQC
Copy link
Contributor

Is your feature request related to a problem? Please describe.
The number of uniforms that can be set are limited by the maximum available vertex uniform components. Using Uniform Buffer Objects overcome this limitation on devices that support it.

Describe the solution you'd like
Provision to set UBOs.

Additional context
In situations such as mesh skinning, large number of uniforms(bone transforms) has to be sent to the GPU. This number is limited by the maximum available vertex uniform components on that device. Introducing UBOs might overcome this limit on some platforms. An issue related to this from Armory3D.

@RobDangerous
Copy link
Member

Hey, false marketing, as you know UBOs are also limited, just less so.

@onelsonic
Copy link

From our research this will open Kha to be used for complex skinning animation on top tier mobile which is not the case now.
The current "vertex uniform" format is not really fit for the Adreno platform.

@RobDangerous
Copy link
Member

Hu, top-tier mobile is still using OpenGL?

@onelsonic
Copy link

Yes life is tough on mobile

So you cannot animated properly on a 1000$ mobile when using Kha.

@RobDangerous
Copy link
Member

Those 26% I think are not the 1000$ top tier phones. And hu, an extension for vertex-skinning? What's that?
And webview is a different story all together of course. When those don't support webgl2 which was only very recently added on iOS, they can't even support UBOs.

@RobDangerous
Copy link
Member

Aand webgl being a different story here will also be relevant for the implementation - therefore henceforth this issue right here will just be about WebGL, while a new issue over at the Kinc-repo will be about OpenGL: Kode/Kinc#708

@RobDangerous RobDangerous changed the title Support for Uniform Buffer Objects [WebGL] Support for Uniform Buffer Objects May 28, 2022
@onelsonic
Copy link

The idea is to be able to handle complex animation bones data in realtime 200+ bones.
Current hardware limitations on Adreno plateforme is throwing errors as not enough uniforms are available when using standard uniforms, so we are trying to find another placeholder for this data.
Uniform Buffer Objects seems to fit the requirements.

Although I hope the number of uniform buffer objects will be enough.
On iOS they are supported natively now on webgl2 (24 Uniform Buffer Objects on a 4 years old iphone/ipad)
On latest android Adreno 600 series (84 Uniform Buffer Objects are available)

Yes most of those 26% are not the 1000$ top tier but many can't run vulkan due to OEM drivers or missing extensions even being the lastest flagship models.
By extension I mean :
VK_EXT_#######
OpenGL ES GL_EXT_#######

When they don't support webgl2, well that are very old mobile devices then.

@RobDangerous
Copy link
Member

iOS only added WebGL 2 support last year. That's not that long ago - basically every iOS device that's not on the latest OS doesn't support WebGL 2. What phones in particular are those that don't support Vulkan? And what extensions do you mean in particular? There are hundreds of EXT extensions and to support Vulkan you don't need to support any extensions.
Also if this is about a specific project of yours - you can just add some extra code until this if fixed and fill the UBOs yourself. The shader-cross-compiler should just keep the buffer structs when compiling to glsl and then it's just, uhm, five GL calls or something along those lines to create and fill them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants