-
-
Notifications
You must be signed in to change notification settings - Fork 97
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
3D Rendering architecture for Godot 4.0 GLES3 #3959
Comments
Does this mean 3D support in OpenGL is planned for Godot 4.0 in the end (even in an "early access" form)?
Can R10G10B10A2 framebuffers be used in GLES3 to still have some kind of HDR rendering (like in Vulkan mobile)? |
Its not planned but that depends on contributors willing to work on it.
The problem with this is that there is not a ton you can do with this tonemapping wise because you start losing precision quickly. I think those framebuffers are more useful on HDR displays (common on phones) and maybe to have some extra precision you want to use for basic glow effects, but thats about it. |
|
I have an experimental PR which incorporates ANGLE builds for UWP (success story), posting this because there's nobody working on this, so might be useful. |
Is OpenGL on Apple platforms a valid use-case? Wouldn't the Vulkan based backends provide much better results with MoltenVK? |
While MoltenVK should be supported on nearly every iOS device in use now, the Vulkan mobile renderer has a different feature set than the planned OpenGL 3D renderer. You generally want to use the same rendering backend on all platforms to ensure consistency. Otherwise, you will have to compensate for the different appearance in your own code, and this can take a lot of time for a solo developer. This different appearance is typically due to the linear versus sRGB rendering, but it's not the only reason it can occur. This also applies to GLES3 and GLES2 in |
Now that #77496 is merged, this proposal is complete (hooray)! We still have more features coming for the Compatibility renderer, but they are not tracked by this proposal |
Describe the project you are working on
Godot
Describe the problem or limitation you are having in your project
Mobile rendering is difficult and it limits the performance that can be obtained. Likewise, we have Godot users that run it in very old desktop hardware that can't do proper latency hiding.
To make it clearer, the following are common problems for mobile rendering:
Describe the feature / enhancement and how it helps to overcome the problem or limitation
Currently in Godot 3.x the GLES3 renderer uses techniques meant for high end, which makes it slow on mobile. Users need to use GLES2 for obtaining higher performance there.
The goal is to make the new GLES3 renderer for Godot 4.0 high performance on mobile by default, given all mobile devices support this level of API nowadays.
Describe how your proposal will work, with code, pseudo-code, mock-ups, and/or diagrams
The 3D rendering process in Godot 4.0 GLES3 should be as follows.
Render Passes
The base pass will be able to render:
Extra lights (directional or positional) with shadow mapping will be rendered in separate passes. There are two main reasons for this:
The extra plus on all this is the fact that large part of the shadow computation can be done in the vertex shader and interpolated towards the fragment one via varying (GLES3 specification supports by default a larger number of varyings).
Base ubershaders (With all enabled, togglable with bool) will be:
Then specialized versions with other features turned off (lightmap, fog, refprobes, etc, specific light combinations) will be handled by the background compiler.
Tone Mapping
We have some restrictions that make tone mapping very difficult:
As such, the following workflow is proposed instead:
This mechanism allows sharing a single RGBA8 (or RGB10A2 depending on configuration) color buffer for 3D and 2D and achieve the best possible performance on old hardware.
Skeletons, Blend Shapes, Particles
Currently in GLES3, skeletons are applied in the vertex shader. This has some problems:
So, the idea is to do skeletons using transform feedback in a similar vein to how Vulkan based back-end does it with compute. This makes it easier also to support Blend Shapes and 8 weights per vertex.
Particles can also be done using transform feedback (Code can be almost be copied from Godot 3), but some features will not work like sub-emitters.
Support on Apple Devices
As OpenGL is being deprecated on Apple devices, we want to always use ANGLE (over Metal) for those platforms.
If this enhancement will not be used often, can it be worked around with a few lines of script?
N/A
Is there a reason why this should be core and not an add-on in the asset library?
N/A
The text was updated successfully, but these errors were encountered: