Skip to main content

ray_march

Function ray_march 

Source
pub fn ray_march(
    ray: &Ray,
    sdf: &dyn Sdf,
    max_steps: usize,
    max_dist: f64,
    eps: f64,
) -> RayMarchResult
Expand description

Perform sphere-marching along ray against the provided SDF.

§Parameters

  • ray – the ray to march.
  • sdf – the scene SDF.
  • max_steps – maximum iteration count (e.g. 128).
  • max_dist – maximum travel distance before declaring a miss.
  • eps – surface threshold: when |d| < eps a hit is declared.