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

Fix Sonic Colors/Unleashed gui (again) #8634

Closed
wants to merge 1 commit into from

Conversation

MastaG
Copy link

@MastaG MastaG commented Feb 17, 2020

See: https://bugs.dolphin-emu.org/issues/11897
When running Sonic using OpenGL ES the gui elements are not rendered at all.

I've confirmed this on two mobiles phones (Samsung Galaxy S9 and Oneplus 7t Pro).
But it can also easily be reproduced on Linux by setting "PreferGLES = True" in GFX.ini.

It renders fine using Vulkan and regular OpenGL without this hack.
However only OpenGL ES seems to run most games at acceptable speeds on Android phones.

@MastaG MastaG requested a review from stenzek February 17, 2020 14:46
@stenzek
Copy link
Contributor

stenzek commented Feb 17, 2020

I wonder if this is due to the lack of depth clamp in GLES. If there's an extension available now which provides this feature, that sounds preferable to a GLES-only hack.

@MastaG
Copy link
Author

MastaG commented Feb 17, 2020

I honestly don't know stenzek.

I was just annoyed by the fact that I needed to use "custom" Android builds (which don't have most of their sources available), just to be able to play the Sonic Wii games using OpenGL ES.
Like I said Vulkan is way too slow (both on my Samsung S9 and Oneplus 7T Pro).

But perhaps you can guard the hack with some IF statement so it only applies when using OpenGL ES because desktop GL and Vulkan are not affected and render the gui in Sonic games just fine.

See: https://bugs.dolphin-emu.org/issues/11897
When running Sonic using OpenGL ES the gui elements are not rendered at all.

I've confirmed this on two mobiles phones (Samsung Galaxy S9 and Oneplus 7t Pro).
But it can also easily be reproduced on Linux by setting "PreferGLES = True" in GFX.ini.

It renders fine using Vulkan and regular OpenGL without this hack.
However only OpenGL ES seems to run most games at acceptable speeds on Android phones.
@MastaG
Copy link
Author

MastaG commented Feb 17, 2020

Anyways I forced push again using only the depth clipping hack and fixed the #include that lint was complaining about.

Furthermore I've tested and verified both desktop OpenGL and OpenGL ES to be working and rendering the gui in Sonic like it should.

Also OpenGL ES was tested again both on Linux (using PreferGLES=True) and using a custom build with Android Studio for my Oneplus 7T Pro.

@leo60228
Copy link

GL_EXT_depth_clamp seems to be identical to ARB_depth_clamp. I can't find any information on driver support, though.

@leo60228
Copy link

It wasn't added to Mesa until February 2019, so most likely very poor.

@MastaG
Copy link
Author

MastaG commented Apr 23, 2020

Hi, any update on this?
Regarding driver support, to my knowledge Android GLES drivers are binary only (and usually not updated until they ship the same GPU in a new device).

And who's going to play Wii games on Mesa's GLES renderer when most Mesa users are using x86 setups with GPU's which have full OpenGL available.

GLES is used in mobile devices only and that's where the projection hack is required to play the Sonic games.

@MastaG
Copy link
Author

MastaG commented Apr 29, 2020

@stenzek Could you please consider merging this taking my last comment in mind.

@leo60228
Copy link

I was just using Mesa as an example. I wouldn't be surprised if it was the first to implement the extension.

@MastaG
Copy link
Author

MastaG commented Apr 29, 2020

Yeah that's why using a GLES extension that was added to Mesa for fixing the issue is not a solution.. since basically nobody is using Dolphin on Mesa with GLES.

Also all existing mobile platforms aren't getting updated driver blobs anyways.

Only thing I can think of would be some guarding in my commit so it only applies it when the GLES renderer is in use.

Perhaps somebody could give some hint on that since I'm not very familiar with the Dolphin code base (and C++ for that matter).

I'd really like to have this fixed so we can play the Sonic games on the official Android builds :)

@Miksel12
Copy link
Contributor

Miksel12 commented Apr 3, 2021

This is fixed by #9591

@JosJuice
Copy link
Member

JosJuice commented Apr 3, 2021

Closing in favor of the other PR, since the implementation in the other PR only activates when the depth clamp extension isn't present.

@JosJuice JosJuice closed this Apr 3, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

5 participants