Skip to main content

volume_render_batch

Function volume_render_batch 

Source
pub fn volume_render_batch(
    sigma: &[f32],
    color: &[f32],
    t_vals: &[f32],
    n_rays: usize,
    n_samples: usize,
) -> NerfResult<(Vec<f32>, Vec<f32>, Vec<f32>)>
Expand description

Volume render a batch of M rays.

  • sigma: [M * N] densities, row-major (ray-major).
  • color: [M * N * 3] RGB colors.
  • t_vals: [M * N] sample positions (same layout as sigma).
  • n_rays: M
  • n_samples: N

Returns (rgb: [M*3], depth: [M], opacity: [M]).

§Errors

Returns DimensionMismatch or EmptyInput for inconsistent inputs.