nerfacc.traverse_grids¶
- nerfacc.traverse_grids(rays_o, rays_d, binaries, aabbs, near_planes=None, far_planes=None, step_size=0.001, cone_angle=0.0, traverse_steps_limit=None, over_allocate=False, rays_mask=None, t_sorted=None, t_indices=None, hits=None)¶
Ray Traversal within Multiple Grids.
Note
This function is not differentiable to any inputs.
- Parameters:
rays_o (Tensor) – (n_rays, 3) Ray origins.
rays_d (Tensor) – (n_rays, 3) Normalized ray directions.
binary_grids – (m, resx, resy, resz) Multiple binary grids with the same resolution.
aabbs (Tensor) – (m, 6) Axis-aligned bounding boxes {xmin, ymin, zmin, xmax, ymax, zmax}.
near_planes (Optional[Tensor]) – Optional. (n_rays,) Near planes for the traversal to start. Default to 0.
far_planes (Optional[Tensor]) – Optional. (n_rays,) Far planes for the traversal to end. Default to infinity.
step_size (Optional[float]) – Optional. Step size for ray traversal. Default to 1e-3.
cone_angle (Optional[float]) – Optional. Cone angle for linearly-increased step size. 0. means constant step size. Default: 0.0.
traverse_steps_limit (Optional[int]) – Optional. Maximum number of samples per ray.
over_allocate (Optional[bool]) – Optional. Whether to over-allocate the memory for the outputs.
rays_mask (Optional[Tensor]) – Optional. (n_rays,) Skip some rays if given.
t_sorted (Optional[Tensor]) – Optional. (n_rays, n_grids * 2) Pre-computed sorted t values for each ray-grid pair. Default to None.
t_indices (Optional[Tensor]) – Optional. (n_rays, n_grids * 2) Pre-computed sorted t indices for each ray-grid pair. Default to None.
hits (Optional[Tensor]) – Optional. (n_rays, n_grids) Pre-computed hit flags for each ray-grid pair. Default to None.
binaries (Tensor) –
- Returns:
A
RayIntervals
object containing the intervals of the ray traversal, and aRaySamples
object containing the samples within each interval. tTensor
of shape (n_rays,) containing the terminated t values for each ray.- Return type:
Tuple[RayIntervals, RaySamples, Tensor]