Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Questions on texturing #21

Open
ttaa9 opened this issue Sep 28, 2019 · 4 comments
Open

Questions on texturing #21

ttaa9 opened this issue Sep 28, 2019 · 4 comments

Comments

@ttaa9
Copy link

ttaa9 commented Sep 28, 2019

  1. Does texture_res do anything when texture_type is vertex? If so, why is it set via self.texture_res = int(np.sqrt(self._textures.shape[2])) in mesh.py?

  2. Could you add code showing how to learn/optimize the texture (vertex and/or surface), as in your paper?

Thanks!

@nikhilaravi
Copy link

I am also interested in the code to learn/optimize the texture!

@ShichenLiu
Copy link
Owner

Hi there,

Yes, so the parametrization of texture in a single triangle could be a little bit tricky but I will try my best to explain it for you. Please feel free to ask me if you have any further questions.

So imagine the triangle barycentric coordinate system as x-axis and y-axis (e.g. V0->V1 is x-axis and V0->V2 is y-axis), then the texture space is a triangle whose vertices are (0, 1), (0, 0) and (1, 0). In order to fully utilize all of the parameters, we parametrize a single triangle as following scheme (we take texture_res == 3 as an example).

demo

This is why a mesh with (texture.shape[2] == 9) is considered as (texture_res == 3)

@shubham-goel
Copy link

Hi @ShichenLiu. Thanks for the explanation!

I have another question regarding the texture. Can you explain the mapping between the texture of NMR and Softras? I have texture_map available in NMR format but need to render it using SoftRas.

In NMR, the texture map is of size (batch_size, num_faces, texture_size, texture_size, texture_size, 3). For softras, I use textures_Softras = textures_NMR[:,:,:,:,0,:].view(b,f,t*t,3) to flatten NMR's texture map. However, the texture of the resulting rendered image seems to be different from NMR.

Can you explain how to compute Softras's texture map from NMR's texture map?

Thanks!

@ShichenLiu
Copy link
Owner

Hi,

It is not straightforward to convert the texture between our's and NMR's. I am afraid the most practical way is to dump them to image and reload?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants