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

How do I use TextureUV with multiple textures #1017

Open
lishi0927 opened this issue Jan 5, 2022 · 4 comments
Open

How do I use TextureUV with multiple textures #1017

lishi0927 opened this issue Jan 5, 2022 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@lishi0927
Copy link

Dear Authors,
I'm glad to use Pytorch3d for my research about differentiable rendering. But now I'm confusion about how to use TextureUV with multiple textures.
I want to train two textures with our custom shader, for example, lightmap and albedomap. I use these two textures in our custom shader to fit the ground truth images, But I find TextureUV supports only one image, TextureAtlas supports multiple textures but it can't be visited through coordinate.
Could you give me some suggestions to acquire these two textures through neural network?
Thank you.

@gkioxari
Copy link
Contributor

gkioxari commented Jan 9, 2022

TexturesUV supports only one image for now.

@gkioxari gkioxari self-assigned this Jan 9, 2022
@gkioxari gkioxari added the enhancement New feature or request label Jan 9, 2022
@lishi0927
Copy link
Author

lishi0927 commented Jan 12, 2022

Thank you for your reply.
I have two ideas about this enhancement. One is that we can write a new type that combine Textureatlas and Textureuv, the other is to modify the Mesh class to support texture lists.
Could you give me some suggestions about this realization, which one would be better or you have best plans?

@bottler
Copy link
Contributor

bottler commented Jan 12, 2022

Both TexturesAtlas and TexturesUV support batches, but these correspond to the batch of meshes. So actually I don't think looking at TexturesAtlas will help.

I think an easy solution would be to create a new TexturesBase subclass which owns a list of TexturesBase objects. Its sample_textures would call sample_textures on each element of the list and concatenate the results along the channel axis. This requires little or no change to existing classes.

(If the UV coordinates are shared then you can use a single mega TexturesUV with many channels.)

@lishi0927
Copy link
Author

lishi0927 commented Jan 13, 2022

Thank you. I have ever tried to expand the length of tensor in TextureUV to 3 * texture_num. But this enhancement can't support different resolutions.
I will try your suggestions.

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

No branches or pull requests

3 participants