Tancik/remove valid mask (#655)

* Install updates

* Remove valid mask logic
This commit is contained in:
Matthew Tancik authored and GitHub committed 2022-10-04 13:54:39 -07:00
1 parent 4f5cc28b8d
commit 6162f9d81f
8 files changed
+13 -85

No files matched your search

@@ -84,12 +84,7 @@ class AABBBoxCollider(SceneBoxCollider):
# clamp to near plane
nears = torch.clamp(nears, min=self.near_plane)
# fars < 0: means the ray is behind the camera
# nears > fars: means no intersection
valid_mask = ((fars > nears).float() * (fars > 0).float()).bool()
nears[~valid_mask] = 0.0
fars[~valid_mask] = 0.0
return nears, fars, valid_mask
return nears, fars
def forward(self, ray_bundle: RayBundle) -> RayBundle:
"""Intersects the rays with the scene box and updates the near and far values.
@@ -99,10 +94,9 @@ class AABBBoxCollider(SceneBoxCollider):
ray_bundle: specified ray bundle to operate on
"""
aabb = self.scene_box.aabb
nears, fars, valid_mask = self._intersect_with_aabb(ray_bundle.origins, ray_bundle.directions, aabb)
nears, fars = self._intersect_with_aabb(ray_bundle.origins, ray_bundle.directions, aabb)
ray_bundle.nears = nears[..., None]
ray_bundle.fars = fars[..., None]
ray_bundle.valid_mask = valid_mask[..., None]
return ray_bundle
@@ -123,5 +117,4 @@ class NearFarCollider(SceneBoxCollider):
ones = torch.ones_like(ray_bundle.origins[..., 0:1])
ray_bundle.nears = ones * self.near_plane
ray_bundle.fars = ones * self.far_plane
ray_bundle.valid_mask = ones.bool()
return ray_bundle