Igalia / wolvic

A fast and secure browser for standalone virtual-reality and augmented-reality headsets.
https://wolvic.org
Mozilla Public License 2.0
758 stars 97 forks source link

Add a glTF/glb loader #473

Open svillar opened 1 year ago

svillar commented 1 year ago

So device vendors are publishing their 3D controller models in the WebXR input profiles repo in Khronos' glTF format. That's great for interoperability. That said, Wolvic does only support loading models in Wavefront obj format. That's the reason why when adding new devices, we tipically import the glTF model into blender and export it to .obj. That has been working rather fine, but we have found some issues lately. For example, in the case of the Meta Quest Pro controllers, the textures are not properly exported and thus the rendering is far from optimal.

In order to avoid those issues it'd be really awesome to have a loader for the glTF format and avoid the conversions.

svillar commented 9 months ago

Note that we're already using a glb loader. It was added not so long ago to be able to load 3D models of hands. So I think we should use that library to implement the loader for 3D models in vrb

HollowMan6 commented 8 months ago

This is harder than I expected. Although we can use tinygltf here to parse the glb file, we still need to investigate how we can integrate the data into the existing code data structure. https://github.com/Igalia/vrb/blob/main/src/ParserObj.cpp Plus I'm not familiar with OpenGL, so anyone who sees this issue and would like to work on this, feel free to change the asignee and remove me.

HollowMan6 commented 8 months ago

Note: We have a gltf branch in FxR's vrb dating back to 2020: https://github.com/MozillaReality/vrb/tree/gltf But it hasn't been implemented at all https://github.com/MozillaReality/vrb/blob/gltf/gltf/LoaderGLTF.cpp