-
-
Notifications
You must be signed in to change notification settings - Fork 21.3k
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
Screen is reversed by 180 degree on old Android devices [GLES3] #17083
Comments
The following problem still exists on version 3.0.2 on Xperia T3. |
I encountered the same problem with Godot 3.0.2 on a Samsung S4 with Android 4.4.2. |
I have helped myself with a workaround (see attached sample as well):
|
Yes... I'm afraid that old Android causes problem. |
Confirmed this problem on I tried to do some research on the problem, here is what I found out:
So I added the rendering of an invisible triangle inside Here is my code, if someone wants to use it: //GodotView.java:663
private static class Renderer implements GLSurfaceView.Renderer {
float[] verticesData = { 2.0f, 0.5f, 0.0f, -0.5f, 1.5f, 0.0f, 2.5f, -0.5f, 0.0f };
FloatBuffer vertices = ByteBuffer.allocateDirect(verticesData.length * 4)
.order(ByteOrder.nativeOrder()).asFloatBuffer().put(verticesData);
public void onDrawFrame(GL10 gl) {
vertices.position(0);
GLES20.glVertexAttribPointer(0, 3, GLES20.GL_FLOAT, false, 0, vertices);
GLES20.glEnableVertexAttribArray(0);
GLES20.glDrawArrays(GLES20.GL_TRIANGLES, 0, 3);
// The rest of onDrawFrame UPD: GLES20.glClear(GLES20.GL_DEPTH_BUFFER_BIT); Instead of drawing triangle seems to work too |
I can confirm the issue: screen renders 180 degrees oposite to the touch controls on HTC M8, running android 5 |
will be fixed this bug in next release? |
Can you try using the GLES2 renderer? |
Using the GLES2 renderer option in the latest build solved the problem for me, tested on a LG G2. |
Yes, GLES2 works fine |
Hello. I has same problem in Godot 3.0.6 / 3.1 alpha_2 and Samsung s3 |
It appears to be fixed with GLES2, so it's not critical for Godot 3.1. If someone can find a fix for those devices on GLES3 that would be great, but low priority given that the GLES3 renderer is going to be replaced by the Vulkan renderer. |
As per the above, the recommended workaround for such devices would be to use the GLES2 renderer. As such I'll close this issue as the GLES3 renderer will be replaced in 4.0, so this issue is unlikely to be fixed (a PR is still welcome if anyone wants to fix it in GLES3 for a 3.2.x release). |
@MednauN I need to fix this issue on 4.2.1 compatibility render (take a look here), can you help me explaining how you fixed it, please? |
Godot version:
3.0.0 and 3.0.1
OS/device including version:
Manjaro Linux
Xperia T3 (D5103), Android 4.4.4
Issue description:
When game is exported to Android, displayed screen is rotated by 180 deg.
This affects only image. Touch screen seems to work correctly.
For example:
When I put a button at top-left corner of the screen it is visible at bottom-right corner.
To press the button I still have to touch top-left corner.
Steps to reproduce:
The following problem appeared to me when stable 3.0 was released.
It worked fine on alpha versions.
Minimal reproduction project:
test.zip
The text was updated successfully, but these errors were encountered: