pmh47 / dirt

DIRT: a fast differentiable renderer for TensorFlow
MIT License
313 stars 63 forks source link

Does your code support rendering from UV map? #27

Closed BigDataHa closed 5 years ago

pmh47 commented 5 years ago

It can be done using deferred shading, where you render a UV coordinate map instead of RGB values, and then use these to bilinearly index a texture afterwards using pure tensorflow ops. Unfortunately I don't have any sample code for this just now, but the idea of deferred shading is illustrated in samples/deferred.py (you would need to add another gbuffer channel for the UV values), and the bilinear texture sampling is similar to a spatial transformer net.

LogWell commented 5 years ago

If time permits, I still hope that the author can update render with texture. It's a little difficult for people who are not familiar with texture to do so.

Thanks a lot~

pmh47 commented 5 years ago

I've added an example of rendering from a UV map using deferred shading in a6fee1fb. See samples/textured.py