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

3.3>... : Software Skinner doesn't work when skinning a non-triangle mesh on Mali GPUs #81470

Open
ahopness opened this issue Sep 9, 2023 · 4 comments

Comments

@ahopness
Copy link

ahopness commented Sep 9, 2023

Godot version

v3.5.2.stable.official [170ba33]

System information

Tested on: Mali-G68 MC4, Mali-G71, Mali-G52 MC1, Adreno 642L & PowerVR Rogue GE8322

Issue description

In my game, i use a wireframe art style, so i transform some meshes into wireframes using a script. One type of these meshes are static scenario parts, which render ok on all mobile devices, another type is characters, skinned models, which just refused to show up on certain phones.

Upon futher inspections, i discovered that this bug was only happening on Mali gpus, which would be ok, and i'd just forget about it, if they wouldn't be the most used gpus on the market rn (and for some reason, all samsung currently phones use them, wild).
The Debugger would throw me this error each time i called surface modifying function on the ArrayMesh Class (e.g. add_surface_from_arrays, surface_remove, surface_set_material) specifically on phones with Mali GPUs:
image

Upon even further inspections, i discorvered that Software Skinning is turn on by default on mobile - because the performance of GPU skinning isn't great overall - and when i turned it off, via disabling software_skinning_fallback in the ProjectSettings, characters where showing up normally.

Steps to reproduce

  1. Grab any skinned model
  2. Add a script to it with the following code:
func _ready():
	var a = mesh.surface_get_arrays(0)
	var m = mesh.surface_get_material(0)
	
	mesh.surface_remove(0)
	
	mesh.add_surface_from_arrays(Mesh.PRIMITIVE_TRIANGLES, a)
	
	mesh.surface_set_material(0, m)
  1. Export to android and run on any phone with a Mali GPU
  2. Go back to the editor, under the ProjectSettings, turn rendering/quality/skinning/software_skinning_fallback off
  3. Test again

Minimal reproduction project

N/A

@ahopness
Copy link
Author

ahopness commented Sep 9, 2023

Btw, i don't think this is related to #43217 in any way because im using neither blend shapes nor gles3

@darksylinc
Copy link
Contributor

Mali HW GPUs doesn't natively support wireframe rendering and must be emulated by the OpenGL driver (and in Vulkan, we have to do the emulation ourselves).

It's extremely likely that the Mali driver is just broken.

You can try getting in touch with ARM.

@ahopness
Copy link
Author

ahopness commented Sep 9, 2023

but this seemed like an issue with the sofware skinning, since skinning the mesh in the gpu works fine (on gles2 and android). are you sure this is an issue with Mali's drivers?

@lawnjelly lawnjelly added this to the 3.x milestone Sep 17, 2023
@lawnjelly
Copy link
Member

The software skinning only appears to support triangles, the wireframe is probably trying to use lines primitive. Maybe the software skinning fallback is only being used on Mali GPUs.

You can test this hypothesis with project_settings/rendering/quality/skinning/force_software_skinning and seeing if you get the same problem on other hardware.

If so this is likely a documentation issue.

You can solve it as you say by turning off software skinning fallback, but be aware that GPU skinning may not work on all mobile platforms.

Also be aware that using wireframe using GL_LINES in any production (especially non desktop) project is a little risky afaik because driver support can be patchy / slow (if you google for this, you may find alternative ways of drawing wireframe with shaders etc).

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

4 participants