gelic-idealab / komodo-unity

Unity VR client for the Komodo XR platform
5 stars 3 forks source link

Siccity loader does not load textures properly #45

Closed parseccentric closed 3 years ago

parseccentric commented 3 years ago

To reproduce: Load a non-Tilt-Brush model that has image textures on it. The model should appear without a texture, like in the case of the Komodo dragon model, or it should be completely invisible, like in the case of models generated with images-to-glbs.glitch.me .

v0.2.0

FireFox with Oculus Runtime and Quest Chrome with Oculus Runtime Quest with Oculus Browser

Models:

parseccentric commented 3 years ago

image Left: v0.2.0 -- dragon is a plain, white material. Right: v0.1.7 -- dragon has multicolored image texture on it.

parseccentric commented 3 years ago

image Left: v0.2.0 -- canvases are completely invisible. Right: v0.2.0 -- canvases are visible.

parseccentric commented 3 years ago

For the dragon, it creates a material properly: image

But is missing an albedo. I'm not sure if the original model has a metallic gloss map. Edit: yes, it is supposed to have both. It does not use any extensions, and is a completely valid GLTF file. image

The mood board is invisible in the editor: image

There is a suspicious error. image

The material itself looks fine, though. image

Aha: the mesh has no triangles. ~I'm not sure why, though. This is a standard cube exported from three.js.~ Edit: instead, the 12 triangles live in the submesh of this mesh. image

If I keep the material the same but change out the MeshFilter to a standard cube, it reveals that the problem for the canvases is a lack of valid mesh rather than a material problem. image

parseccentric commented 3 years ago

I think I'm stuck.

The Siccity docs (paltry as they are, sadly) indicate that static meshes, including submeshes, are supposed to be supported.

I tried looking up submeshes to understand them better, but the GLTF 2.0 Specification does not even mention them. The explanation is that submeshes can be thought of as the content of the mesh, which is actually an array. So submeshes are elements of the primitive array. At least, according to my understanding of this Microsoft documentation quote:

Submeshes are defined in the array of primitives on the mesh in the object. Source: https://docs.microsoft.com/en-us/windows/mixed-reality/distribute/creating-3d-models-for-use-in-the-windows-mixed-reality-home#node-counts-and-submesh-limits

Other folks having related problems:

davtamay commented 3 years ago

Good information gathered. Can you remember if 0.17 was using Trilib?

parseccentric commented 3 years ago

I believe so.

I am currently trying out swapping Siccity/UnityGLTF with https://github.com/atteneder/glTFast , which interestingly De-Panther WebXR Exporter uses.

If this works, I will be really excited, because look at this super awesome demo page they have. https://atteneder.github.io/glTFastWebDemo/?#

davtamay commented 3 years ago

Cool yes that sounds good, it is supposed to make asset importing faster. I was going to implement it but I got discouraged because I read it lacked some features still such as Animations.

davtamay commented 3 years ago

Interesting recent release thought, his importer may fix issues with using big assets. Doing async is the way to go, Siccity offers async but we currently have loading functionality being done in sync which might explain the run time issues we may be experiencing with large assets. I just saw that Siccity does offer async funcionality but is not as straight forward as our current implementation (We have to send a delegate when calling the loader and wait until we get the object back through the callback)

parseccentric commented 3 years ago

Cool yes that sounds good, it is supposed to make asset importing faster. I was going to implement it but I got discouraged because I read it lacked some features still such as Animations.

Yeah, I find this disappointing too. Maybe now we can use multiple loaders -- GLTFast for most cases, and then Siccity for animations.

Interesting recent release thought, his importer may fix issues with using big assets. Doing async is the way to go, Siccity offers async but we currently have loading functionality being done in sync which might explain the run time issues we may be experiencing with large assets. I just saw that Siccity does offer async funcionality but is not as straight forward as our current implementation (We have to send a delegate when calling the loader and wait until we get the object back through the callback)

Hmm. I am thinking about starting a new Komodo Internal thread to keep info about async-await in one place. I am trying to wrap my head around it, and some users report there's super buggy behavior when using WebGL and WASM.

parseccentric commented 3 years ago

Summary of progress in my local branch:

This works fine in the editor.

For some reason, when I go to test it on the dev server, it gives an error about the local filesystem access. image

GLTFast does have its own download handler. Do you think we could integrate that with our existing system?

wallacerob commented 3 years ago

@parseccentric any updates for this one? Maybe ok to close now that we have a dev build with glTFast working?