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

Add Etc2 texture format support. #6864

Merged
merged 1 commit into from
Nov 2, 2019
Merged

Add Etc2 texture format support. #6864

merged 1 commit into from
Nov 2, 2019

Conversation

ryancheung
Copy link
Contributor

No description provided.

@ryancheung
Copy link
Contributor Author

I really need the ETC2 texture formats. 😃

@@ -35,7 +35,7 @@ public class GraphicsContext : IGraphicsContext
{
public GraphicsContext ()
{
Context = new EAGLContext (EAGLRenderingAPI.OpenGLES2);
Context = new EAGLContext (EAGLRenderingAPI.OpenGLES3);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Documentation is sparse, so I don't know what happens here if the device does not support GLES3. I assume it will either throw or return null. I don't see an easy way to fallback to GLES2 in the API. I think we need to create a context and use glGetString to check the supported version if we want to continue to support GLES2.

Not sure if we should still support GLES2 on iOS though. A quick search indicates iPhone supported GLES3 in iOS 7+ since iPhone 5S/iPad Air.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, iOS devices have good upgrade rate to latest version.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah i think for now it would be best to fallback to GLES2 if possible. It would suck to hurt install base of existing users unless we really have to.

if (major >= 3)
Context = new EAGLContext (EAGLRenderingAPI.OpenGLES3);
else
Context = new EAGLContext (EAGLRenderingAPI.OpenGLES2);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just added the fallback check. Could you be sure this is capable? @tomspilman @Jjagg

@ryancheung
Copy link
Contributor Author

ryancheung commented Nov 2, 2019

Commit Edit: Init EGALContext with GLES3 if ios version is 7 or above.
Since doc in Apple show GLES3 was supported since ios 7.

@ryancheung
Copy link
Contributor Author

ryancheung commented Nov 2, 2019

@Jjagg @cra0zy Could u consider merging this PR?

@Jjagg
Copy link
Contributor

Jjagg commented Nov 2, 2019

Yeah, this is great! Thanks @ryancheung!
We'll should look into supporting etc2 in the content pipeline as well and making it the default compression for textures on mobile.

@Jjagg Jjagg merged commit 68e4e89 into MonoGame:develop Nov 2, 2019
@ryancheung ryancheung deleted the etc2-texture-format-support branch November 3, 2019 00:07
@harry-cpp harry-cpp added this to the 3.8 Release milestone Jun 14, 2020
@tomspilman tomspilman changed the title Etc2 texture formats. Add Etc2 texture format support. Aug 1, 2020
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

Successfully merging this pull request may close these issues.

4 participants