pytorch_volumetric
pytorch_volumetric copied to clipboard
Is it possible to make sdf calculation differentiable?
Say I have a point p=(xyz), and a distance d = sdf(p), I want to do something like d.backward() to get p.grad? I was able to do it with TORCH_SDF library(a modified version of Kaolin), but it seems I cannot do it with pytorch_volumetric?
I think you may implement this with the sdf_grad in: sdf_val, sdf_grad = sdf(pts) However, instead of apply sdf_grad to sdf_val, it should be applied to pts directly. This may because the sdf function is rather implemented in an implicit way, which means there's no analytical differential relationship between sdf_value and pts.