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

Skeleton2D Node Makes Polygon2D Textures Dark in Android [GLES3] #27919

Closed
sarooptech opened this issue Apr 11, 2019 · 20 comments
Closed

Skeleton2D Node Makes Polygon2D Textures Dark in Android [GLES3] #27919

sarooptech opened this issue Apr 11, 2019 · 20 comments

Comments

@sarooptech
Copy link

sarooptech commented Apr 11, 2019

Godot version: 3.1.stable.official

OS/device including version: Android 8.1 (Realme 1)

Issue description: When I create a character using polygons and run it on Android Device everything looks okay but when I assign Skeleton2D Node to it Textures of Polygon turns Dark.

Screenshots:

Output On Linux
Linux

Results On Android
Android

Steps to reproduce: Create 2D character with polygons and then Create and Assign Skeleton2D Node to it. Run it on android device.

Minimal reproduction project:
SkeletonBug.zip

@Calinou
Copy link
Member

Calinou commented Sep 4, 2019

The reproduction project uses the GLES3 renderer. Can you reproduce this issue if you switch to the GLES2 renderer in the Project Settings? (Rendering > Quality > Driver > Driver Name)

Judging by the screenshot, it seems sRGB colors are being forced on the texture with Skeleton2D assigned, but only on Android. This will look correct in 3D, but it will look wrong in 2D.

@sarooptech
Copy link
Author

  • As you (@Calinou ) suggested I used same Project and Switched to GLES2 Renderer. This time Character With Skeleton2D didn't even showed up. You can see it in following screenshot.

GLES2

@Calinou
Copy link
Member

Calinou commented Sep 4, 2019

@samdaiya Skeleton2Ds disappearing in GLES2 seem to be the same issue as #26933.

@sarooptech
Copy link
Author

What should I do to solve this? Any Workgrounds or permanent Solution?

@sarooptech
Copy link
Author

The reproduction project uses the GLES3 renderer. Can you reproduce this issue if you switch to the GLES2 renderer in the Project Settings? (Rendering > Quality > Driver > Driver Name)

Judging by the screenshot, it seems sRGB colors are being forced on the texture with Skeleton2D assigned, but only on Android. This will look correct in 3D, but it will look wrong in 2D.

Should I expect this to be solved in 3.2 or I just distch using New Skeleton2D System?

@Calinou
Copy link
Member

Calinou commented Nov 17, 2019

@samdaiya Since 3.2 is in feature freeze and nobody has been working on this, I don't think this will be fixed by the time it's released. It may be fixed in a point release in the future (no guarantees).

@sarooptech
Copy link
Author

sarooptech commented Nov 18, 2019

It's sad to hear that. It's really good feature but Only Android have this problem. I've tried to track down problem myself but couldn't. Where should I look to solve this problem? I've checked Polygon2d and Skeleton2D classes but couldn't find any issues in them.

@Calinou
Copy link
Member

Calinou commented Nov 18, 2019

@samdaiya This is likely related to mobile graphics drivers, which are unfortunately difficult to debug (especially if you don't have OpenGL experience).

@sarooptech
Copy link
Author

I'm still learning basic OpenGL. Hopefully it will be solved in 3.2.x. Until then I will use old method for skeleton Animation without Polygon2D.

@akien-mga akien-mga changed the title Skeleton2D Node Makes Polygone Textures Dark in Android Skeleton2D Node Makes Polygone Textures Dark in Android [GLES3] Jan 15, 2020
@akien-mga
Copy link
Member

akien-mga commented Jan 15, 2020

Tested in the current master branch (bab91bd) on two devices:

  • Samsung Galaxy S3 (old, GLES2): the polygon character with Skeleton2D is not displayed at all.
  • Xiaomi Pocophone F1 (recent):
    • GLES2: Works fine.
    • GLES3: Same as OP, the character with Skeleton2D appears darker than the other one.

So the bug in OP is GLES3-specific, but old GLES2 devices have an even harder time with Skeleton2D.

I'll open a new issue for the GLES2 issue.

@akien-mga akien-mga changed the title Skeleton2D Node Makes Polygone Textures Dark in Android [GLES3] Skeleton2D Node Makes Polygon2D Textures Dark in Android [GLES3] Jan 15, 2020
@clayjohn clayjohn removed this from the 3.2 milestone Jan 15, 2020
@clayjohn clayjohn added the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Jan 15, 2020
@clayjohn
Copy link
Member

Aiming for the 3.2.1 release

@sarooptech
Copy link
Author

Aiming for the 3.2.1 release

Good to know.

@sarooptech
Copy link
Author

Any update on this? Still facing the problem.

@Calinou
Copy link
Member

Calinou commented Oct 28, 2020

@samdaiya It might be worth checking whether 3.2.4 beta1 solves this issue. It has new GLES3 rendering code that supports batching. You can also check whether this has been fixed in GLES2.

@lawnjelly
Copy link
Member

Yes in 3.2.4 2d software skinning is supported in GLES2 and GLES3 (and is on by default). This should hopefully solve the problem of skeletons not working on some GLES2 hardware. As to the colors, I'm not sure off hand. The 2d polygons have vertex coloring if I remember correctly. Could be a linear / sRGB discrepancy.

@sarooptech
Copy link
Author

I downloaded v3.2.4.beta1.official and imported SkeletonBug in it, Now Godot Editor ( GLES2/GLES3 ) is not able to show Polygons2Ds that have Skeleton2D attached to them. Also it is not visible in Android.

Here's the SS:
Polygon2D

@lawnjelly
Copy link
Member

lawnjelly commented Oct 29, 2020

I'll have a look when I get back, there may be another skinning bug to solve (I've only had 3 test projects to test for regressions). But it is unlikely to be a big problem, and if it works on desktop it should work on android (as the shader is quite simple).

Until then you could test these projects on android:
#35772
#42576 (comment)

Edit: When I had a look at skeleton_bug.zip, it doesn't seem like the project is set up correctly to work in 3.2. The objects were not synced to the bones in the skeleton. When I synced the bones and rigged the arm, it worked. Perhaps there have been some compatibility changes in import since the project was made?

There is actually some difference occurring in the unsynced (broken) position in 3.2.4 versus 3.2.1, but it works once it has been rigged correctly. I will investigate the difference when I'm back.

The strange behaviour may be because it is not rigged correctly. This could be causing some uninitialized value or something. Even when rigged correctly for the arm, it shows up correctly with batching on (i.e. software skinning), but not with batching off, indicating earlier bones may be corrupting the skeleton.

Ah I've realised there may be some interaction with the legacy draw polys bug that is present in 3.2.4 beta 1 (since fixed). This might explain the difference in behaviour compared to 3.2.1 when the character is not rigged correctly.

@sarooptech
Copy link
Author

sarooptech commented Oct 29, 2020

  • I tested both of the projects as you shared and they are working properly.

  • After that i created my own project and synced bones ( I probably forgot to do that in previous project, it was long time ago and I don't remember it ). Seems like it's working properly on both Android & Desktop with both GLES2 & GLES3.

  • Thanks @Calinou, @lawnjelly and anyone else who helped to fix it. I can finally start remaking my old game.

  • Here's the latest project I created if anyone else want to test it too. -> SkeletonTest.zip

@sarooptech
Copy link
Author

Should I close this issue now?

@akien-mga akien-mga removed the cherrypick:3.x Considered for cherry-picking into a future 3.x release label Nov 28, 2020
@akien-mga
Copy link
Member

Closing as this now seems fixed.

@akien-mga akien-mga added this to the 3.2 milestone Nov 28, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants