request: glb export to include a texture for using in glTF PBR workflows

#8
by rawwerks - opened

first off - i want to say that this tool is truly awesome!

i have one nit-pick, that is just related to the glTF (.glb) export details: is there a reason that the triposr doesn't use textures when exporting to .glb?

from inspecting the file, it seems the color is written directly into the mesh (versus mapping a texture), which makes it difficult to use the resulting .glb/glTF files downstream in a PBR workflow.

for example: the triposr files render in some viewers (modelviewer.dev/editor) but not others (gltf.report)

because there are no texture files, it's also difficult to process them, for example to convert to .usdz for iOS AR viewing.

image.png

right now it looks like only vertex colors are being used: https://github.com/VAST-AI-Research/TripoSR/blob/00319be2f08ddd06a43edf05fbbd46b5ea1e9228/tsr/system.py#L200C17-L200C51

i'm not familiar with trimesh, but it shouldn't be too hard to convert the vertex colors into a texture:

i think you can use the .to_texture() function => https://trimesh.org/trimesh.visual.color.html#trimesh.visual.color.ColorVisuals.to_texture

https://trimesh.org/trimesh.visual.color.html

I think, you need some lib, for example, ThreeJs, Aframe.

Gltf interesting for me. I playing now with that libs by using JS

Sign up or log in to comment