aframevr / aframe

:a: Web framework for building virtual reality experiences.
https://aframe.io/
MIT License
16.51k stars 3.92k forks source link

GLTF model not rendered #3997

Open ChristopheBougere opened 5 years ago

ChristopheBougere commented 5 years ago

Description: I am trying to load a .glb in aframe, but it seems only the edges are rendered (see the Glitch): image However, if I open the same model in gltf-viewer, it renders well: image For information, it's a .fbx animated model from mixamo.com converted in .glb using FBX2glTF. You can download it here.But as it works well on gltf-viewer, I assume it should be fine in aframe.

ngokevin commented 5 years ago

A-Frame 0.7.1 is pretty old. glTF loaders have upgraded since. Can you try 0.8.2 or master? https://cdn.jsdelivr.net/gh/aframevr/aframe@1c546c1315eeae6c3e1e3823b7b1564a3835536f/dist/aframe-master.min.js

ChristopheBougere commented 5 years ago

Oops, it's already 0.8.2, my bad (I upgraded when creating the issue). (just tried with master, same result)

arpu commented 5 years ago

does the model use draco compression?

ChristopheBougere commented 5 years ago

I have tried with and without the --draco option in FBX2glTF and the result is the same in both cases. Here is the original .fbx (zipped) liam@Sitting.zip

I hope it answers the question?

dmarcos commented 5 years ago

I can't reproduce the problem originally stated. Using master the model loads but with no shading / textures (no errors, warnings on console):

image

Maybe an issue with lighting, gamma output... @donmccurdy might know

dsinni commented 5 years ago

FWIW, I'm experiencing the same as above when in standard mode, but entering fullscreen seems to show a more accurate representation.

Standard view: image

Fullscreen view: image

donmccurdy commented 5 years ago

Going fullscreen fixes it for me too, sometimes. That's bizarre. Seeing some ideas on https://stackoverflow.com/questions/34385682/three-js-texture-goes-all-white but nothing obvious. 😫

ChristopheBougere commented 5 years ago

So the screenshot from my original post was on Firefox, but if I try it on Chrome I only got the outline too. And when I go fullscreen, the not-rendered pieces are in black instead of white. Oh, here are the logs of the conversion if that helps:

./node_modules/fbx2gltf/bin/Linux/FBX2glTF --input liam@Sitting.fbx --output ./new4.glb -b
Warning: node /RootNode/default uses unsupported transform inheritance type 'eInheritRrSs'.
         (Further warnings of this type squelched.)
Warning: Mat [Bodymat]: Can't handle texture for TransparentColor; discarding.
Warning: Mat [Bodymat]: Can't handle texture for TransparentColor; discarding.
Warning: Mat [Bodymat]: Can't handle texture for TransparentColor; discarding.
Warning: Mat [Topmat]: Can't handle texture for TransparentColor; discarding.
Warning: Mat [Bottommat]: Can't handle texture for TransparentColor; discarding.
Warning: Mat [Shoesmat]: Can't handle texture for TransparentColor; discarding.
Wrote 21356589 bytes of binary glTF to ./new4.glb.glb.
colinfizgig commented 5 years ago

I’ve seen this with Mixamo exports in other tools. Are the textures .png? Before you convert in the fbx2gltf? If so try running them through photoshop or some image editor and removing any alpha channels. Then save the textures and try reconverting. The main thing is to get any alpha channels out of the texture. Mixamo uses overlapping alpha textures to change clothes and hair style. If you have a 3D modeler you may even want to merge some of your textures together in order to optimize the model and texture count. There may even be some transparent cornia textures or eyelashes which you will have issues with based on default material setups coming out of Mixamo. I’ve been through it several times. Once you know how to fix it it’s not to bad, but if one of what I said above makes sense it may take some work for you to fix it.

One alternative for you to try which may be easier and better. Try opening the FBX in the three.js editor. Then drill down to the materials for each object. Convert them to standard materials instead of phong or whatever Mixamo is exporting. Reattach the textures and export as .glb from the editor. That may fix the issue without the alpha channel fixes mentioned above.

Hope that helps. Not ire what’s going on with the full screen view stuff?