shubham-goel / ds

Code for Differentiable Stereopsis. Goel, Gkioxari, Malik 2021
69 stars 8 forks source link

How to save textured mesh ? #1

Open Jiakui opened 2 years ago

Jiakui commented 2 years ago

Dear author,

Thanks for your awesome work .

Right now I need textured mesh so that I could show it with a webGL engine to my customer, I saw that there is save_textured_mesh.py so I wonder how I can use this funtion to save textured mesh .

In the evalute_ds.py file, mesh_pred = eval_model.build_mesh() seems to give me a mesh without texture. How can I get the textures and then save it with save_textured_mesh.py ?

Any suggestions ?

Thanks!

shubham-goel commented 2 years ago

Hi @Jiakui. Thank you for asking, this is something I've thought about before.

To make DS work with differentiable rendering, we assumed that the 2 sides of each face are textured independently. However, two-sided texture for mesh faces is not supported universally in viewers, so I didn't invest the time in writing scripts for saving textured meshes.

I could make it work with backface culling -- duplicating the geometry and assigning separate textures (for front and back faces) to each mesh. However, it isn't the most elegant solution as it messes with the geometry.

Do you have any suggestions on what format to save 2-sided texture in, and what viewers to use to visualize it?

Best, Shubham