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

Incorporate opengles support #299

Open
OptimisticPeach opened this issue Dec 25, 2018 · 3 comments
Open

Incorporate opengles support #299

OptimisticPeach opened this issue Dec 25, 2018 · 3 comments

Comments

@OptimisticPeach
Copy link

Hi there, I have been using opengles_graphics as of late, and have noticed that it is rather old (2 years ago was the last commit), and so I was wondering if opengles support could be added to opengl_graphics. Currently I use a fork of opengles_graphics (So a fork of a fork of this repo) which allows me to use newer libraries in my android/opengles projects, but it's unwieldy to work with, not to mention that I'm not going to maintain my fork of opengles_graphics because of my inexperience in opengl (much less opengles).
Thanks!

@agausmann
Copy link
Contributor

agausmann commented Oct 18, 2019

In my experience, opengl_graphics works fine with OpenGL ES 2.1/3.0. Have you tried using this crate instead?


E: My use case wasn't GL ES per se, but it was the emulated layer in Emscripten. There is technically a difference in that it uses different shaders (Emscripten uses WebGL in the backend and hence requires WebGL shaders), and it appears that opengles_graphics exists for a similar reason.

I'd still be interested in seeing what specific errors are raised by running this crate on OpenGL ES. My guess is that they'll be related to shader compilation.

@OptimisticPeach
Copy link
Author

A few things actually, since we're targeting OpenGLES 3.1, the bindings change and break some things, and the shaders must be rewritten using a different kind of glsl:

// Vertex Shader
#version 300 es
in vec4 color;
in vec2 pos; 

out vec4 v_Color;

void main() {
    v_Color = color;
    gl_Position = vec4(pos, 0.0, 1.0);
}
// Fragment Shader
#version 300 es
precision mediump float;

in vec4 v_Color;
out vec4 outColor;

void main() {
    outColor = v_Color;
}

Which happens to not be what opengles_graphics does.

By the way, opengles_graphics is ancient, and it seems the author agrees and has archived the repo.

I don't have a reproducible build of using opengl_graphics when OpenGLES is requested currently but I'll make one in the near future.

@agausmann
Copy link
Contributor

Which happens to not be what opengles_graphics does.

As far as I could tell, the majority of changes involve replacing shader-related code.

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

2 participants