ShichenLiu / SoftRas

Project page of paper "Soft Rasterizer: A Differentiable Renderer for Image-based 3D Reasoning"
MIT License
1.23k stars 156 forks source link

Barycentric clipping #30

Closed nikhilaravi closed 4 years ago

nikhilaravi commented 5 years ago

Can you explain why you have this clipping step before calculating the z buffer value?

https://github.com/ShichenLiu/SoftRas/blob/master/soft_renderer/cuda/soft_rasterize_cuda_kernel.cu#L398-L399

ShichenLiu commented 5 years ago

Hi,

We clip the z value to avoid it from being too large due to extrapolating triangle depth that are almost perpendicular to the image plane.