Skip to content
This repository has been archived by the owner on Nov 19, 2024. It is now read-only.

[vnext] Models don't seem to render correctly. #49

Closed
preyneyv opened this issue Jan 6, 2022 · 4 comments
Closed

[vnext] Models don't seem to render correctly. #49

preyneyv opened this issue Jan 6, 2022 · 4 comments

Comments

@preyneyv
Copy link

preyneyv commented Jan 6, 2022

Hi again! I finally got a chance to play around with your rewrite. It seems to work as advertised for models without bones and animations, but it starts behaving quite strangely once they're added. I'm testing using Microsoft's 3D Viewer, donmccurdy's glTF Viewer (based on Three.js), and the Babylon.js Sandbox. The screenshots below are in the same order.

No SKL, No Anim

Works perfectly in all three viewers.

3D Viewer

glTF Viewer

Babylon

SKL, No Anim

Interestingly has a different issue in each viewer. 3D Viewer just collapses the model, Three.js ignores the scaling, so the model is massive (like you mentioned here: #44 (comment)), and Babylon.js has inverted normals.

3D Viewer

glTF Viewer

Babylon

SKL with Anim

Seems to work in 3D Viewer but the model is really massive. Never loads in Three.js, just indefinitely hangs. Loads correctly in Babylon.js, but has inverted normals again. Animations work in both 3D Viewer and Babylon.js.

3D Viewer (you can't tell in this photo but it looks right.)

glTF Viewer never loaded.

Babylon

@Jochem-W
Copy link
Owner

Jochem-W commented Jan 7, 2022

I don't think I can fix the model collapsing in 3D Viewer when it's not animated. I also don't think I can do much about the model not loading at all in certain viewers or being really slow, I'm guessing that's because of the file size/complexity.

The model appearing too big in 3D Viewer and with scaling issues in Three.js has been fixed in 05cdb29, but this scaling of the root and skeleton root node is also what causes the inverted normals in Babylon. The only fix for this is to not scale the model at all when it has a skeleton, which is what I've done.

In 2507571 I've made it so the default behaviour is to not scale skinned meshes (meshes with a skeleton) unless --force-scale is used. This means you will have to manually invert the X-axis in whatever viewer you use.

I'm closing this issue but if this doesn't work for you or there are still other issues with other viewers, feel free to reopen.

@Jochem-W Jochem-W closed this as completed Jan 7, 2022
@Jochem-W
Copy link
Owner

Jochem-W commented Jan 7, 2022

The current solution has the following problems that I probably won't fix:

@preyneyv
Copy link
Author

preyneyv commented Jan 7, 2022

Thanks for the quick fix! Models exported with the latest build seem to be behaving as expected :D

Another thing I noticed (although this probably warrants its own issue) is that models with “hidden” meshes still have everything visible. For instance, if you look at Star Guardian Ezreal, the model exported with SimpleGLTF has his wings visible, while the model from SharpGLTF has them hidden. Similarly, Crime City Nightmare Akali has a very glitchy model under vnext because it looks like she has two meshes at the same position (one bright and one for stealth).

(Also I’m sorry to keep throwing these issues at you! 😔)

@Jochem-W
Copy link
Owner

Jochem-W commented Jan 8, 2022

No problem!

As for hiding meshes, I'm still trying to figure out what the best way to implement that is and I already have an issue for it here #47.

I just pushed 0da92e7 which adds the option -k to keep hidden sub meshes (defaults to false). This means that now by default all hidden sub meshes will be removed from the final glTF file with no way of unhiding them. Even after getting rid of all the hidden sub meshes, there will still be models that don't appear correctly, like High Noon Irelia. I'm not 100% sure if I can fix those without adding a bunch of exceptions for certain models, which I'm not sure is something I will do.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants