Bug fix in rendering clipped meshes

Summary:
There was a bug when `z_clip_value` is not None but there are no faces which are actually visible in the image due to culling.  In `rasterize_meshes.py` a function `convert_clipped_rasterization_to_original_faces` is called to convert the clipped face indices etc back to the unclipped versions, but the case where there is no clipping was not handled correctly.

Fixes Github Issue #632

Reviewed By: bottler

Differential Revision: D29116150

fbshipit-source-id: fae82a0b4848c84b3ed7c7b04ef5c9848352cf5c
This commit is contained in:
Nikhila Ravi
2021-06-15 07:50:33 -07:00
committed by Facebook GitHub Bot
parent bc8361fa47
commit c75ca04cf7
2 changed files with 29 additions and 18 deletions

View File

@@ -638,8 +638,11 @@ def convert_clipped_rasterization_to_original_faces(
"""
faces_clipped_to_unclipped_idx = clipped_faces.faces_clipped_to_unclipped_idx
# If no clipping or culling then return inputs
if faces_clipped_to_unclipped_idx is None:
# If no clipping then return inputs
if (
faces_clipped_to_unclipped_idx is None
or faces_clipped_to_unclipped_idx.numel() == 0
):
return pix_to_face_clipped, bary_coords_clipped
device = pix_to_face_clipped.device