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

skinning doesn't work with low bone limit and no bone texture support #518

Closed
daredevildave opened this issue Feb 16, 2016 · 7 comments · Fixed by #6188
Closed

skinning doesn't work with low bone limit and no bone texture support #518

daredevildave opened this issue Feb 16, 2016 · 7 comments · Fixed by #6188
Assignees
Labels
area: graphics Graphics related issue bug

Comments

@daredevildave
Copy link
Contributor

If there is no bone texture support and skin splitting is required the skinning doesn't work properly (deformed).

To try this add these lines to Doom 3 Gangnam style or other project with skinned characters.

app.graphicsDevice.supportsBoneTextures = false;
app.graphicsDevice.boneLimit = 20;
@willeastcott
Copy link
Contributor

willeastcott commented Mar 5, 2018

I just verified that the skin splitting does work. I suspect maybe you executed those lines after the model JSON has been parsed. To see the skin partitioner work, just have the texture_float extension return null and set the max vertex uniforms to 128. Then you'll get a bone limit of about 21. And it does actually work. The problem is that the engine has changed how it handles material mappings in the last few years. The skin partitioner does handle the mappings when they are passed in as a parameter. However, these days, the call has been changed to pass null. So materials are incorrectly assigned. And the extra mesh instances generated from the split simply get the default material:

image

The current skin splitter is really bad for other reasons too.

  1. It manipulates the source JSON model format. It doesn't split the runtime format. This mean that if you load a glTF skinned model, say, the skin partitioner cannot split it.
  2. Picking in the Editor 3D view starts to return the wrong mesh instances for split skins. I can't exactly say why, but I've seen this happen.

I'm wondering if we should consider ripping it out and falling back to CPU skinning where necessary. I mean, we already have a CPU morphing path.

@willeastcott willeastcott added the area: graphics Graphics related issue label Apr 15, 2020
@mvaligursky
Copy link
Contributor

Another option here would be to fallback on the RGBA8/16 textures to store matrices. It would be lots more texture samples to get 4x3 matrix of floats, but should still be faster than CPU skinning.

These are the stats on vertex texture sampling support from about a year ago when webglstats still worked.
vertex texture reads: 4: 97.7%, 8: 79.9%, 16: 67.0%

@willeastcott
Copy link
Contributor

Wow, that's a cool idea, @mvaligursky. Deleting all that skin partitioning code from the engine would be great.

@mvaligursky
Copy link
Contributor

are we ok to drop support for up to 2% of devices (based on stats from a year ago) and do this? Or would we still need to do some backup CPU skinning or similar.

@mvaligursky mvaligursky self-assigned this Sep 28, 2021
@willeastcott
Copy link
Contributor

This is a really difficult question to answer. On the one hand, I've always preferred we ensure the engine's core feature set runs on a minimum WebGL 1.0 spec. See webgl.min_capability_mode. However, the skin splitting path is clearly broken at the moment, and I'm not aware of anybody complaining. I'm really torn, TBH!

@mvaligursky
Copy link
Contributor

Latest stats (1 Jun 2023) based on web3dsurvey.com

WebGL2 support: 97.61%

Screenshot 2023-06-01 at 11 45 38

MAX_VERTEX_TEXTURE_IMAGE_UNITS:
WebGL1, 4 vertex textures: 99.91% (android: 99.55%, Chromium, iOS, MacOS, Windows: 100%)
WebGl2, 4 vertex textures: 100%

OES_texture_float:
WebGL1: 95.72% (android: 72.65%, Chromium: 94.6%, iOS: 99.96%, MacOS: 99.97%, Windows: 99.95%)
WebGl2: 100%

So out of about 2.4% of devices that support only WebGL1, about 4.3% does not support float textures, which is 1% of the whole market.

@willeastcott
Copy link
Contributor

Don't you mean 0.1%? 😄

Yeah, I think we can just close this now and rip out that skin split stuff.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: graphics Graphics related issue bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants