MCPcopy Create free account
hub / github.com/Bloom-Engine/engine / pdf

Method pdf

tools/bloom-reference/src/main.rs:1655–1665  ·  view source on GitHub ↗

PDF (per solid angle) of the env distribution for a given direction. Evaluates the pixel the direction maps to and converts back to solid-angle measure.

(&self, direction: Vec3)

Source from the content-addressed store, hash-verified

1653 /// direction. Evaluates the pixel the direction maps to and
1654 /// converts back to solid-angle measure.
1655 fn pdf(&self, direction: Vec3) -> f32 {
1656 let (x, y, sin_theta) = self.direction_to_pixel(direction);
1657 if sin_theta <= 0.0 {
1658 return 0.0;
1659 }
1660 let pixel_p = self.distribution.pixel_pdf(x, y);
1661 let omega_per_pixel = (2.0 * std::f32::consts::PI / self.width as f32)
1662 * (std::f32::consts::PI / self.height as f32)
1663 * sin_theta;
1664 pixel_p / omega_per_pixel
1665 }
1666}
1667
1668// ============================================================

Callers 1

trace_pathFunction · 0.80

Calls 2

direction_to_pixelMethod · 0.80
pixel_pdfMethod · 0.80

Tested by

no test coverage detected