tensorflow / graphics

TensorFlow Graphics: Differentiable Graphics Layers for TensorFlow
Apache License 2.0
2.76k stars 365 forks source link

Rasterization with shading #28

Closed francoisruty closed 5 years ago

francoisruty commented 5 years ago

https://github.com/tensorflow/graphics/blob/master/tensorflow_graphics/rendering/differentiable_renderer/rasterizer.py

thanks for the link, I'm going to test this on my use case and I'll get back to you if I find issues. I just have a small question: currently I use the old Google tf_mesh_renderer which does rasterization + phong shading. According to you, should I try to use TFG rasterizer and plug it to tf_mesh_renderer phong_shader, or should I try to do rasterization + shading in TFG?

So far I would tend to use TFG current rasterizer output and tf_mesh_renderer phong_shader, since TFG currently has on the rendering side a few utils function but nothing that takes a rasterizer output in input

julienvalentin commented 5 years ago

We have phong shading in TFG: https://github.com/tensorflow/graphics/tree/master/tensorflow_graphics/rendering/reflectance

If you want diffuse + specular, you would want to use a weighted sum of the lambertian and phong shaders contained in that folder. Let me know if you have further questions.

francoisruty commented 5 years ago

thanks, now waiting for updates on the rasterizer before testing all this, I'll let you know!

julienvalentin commented 5 years ago

you should be able to test feasibility with the existing rasterizer, the new version will mainly improve performance

francoisruty commented 5 years ago

I'm waiting for feedback on https://github.com/tensorflow/graphics/issues/23 (if I understood correctly there is no support provided at the moment for the rasterizer since it's not officially released yet, so I'm waiting for the release)

julienvalentin commented 5 years ago

I just updated that thread. You are right that I'd prefer to not commit to giving support on experimental components.

Best.