[][src]Module tray_rust::mc

Defines various Monte Carlo sampling functions for sampling points/directions on objects and computing the corresponding pdfs

Functions

concentric_sample_disk

Compute concentric sample positions on a unit disk mapping input from range [0, 1) to sample positions on a disk samples should be two random samples in range [0, 1) See: Shirley and Chiu, A Low Distortion Map Between Disk and Square

cos_hemisphere_pdf

Compute the PDF of the cosine weighted hemisphere sampling

cos_sample_hemisphere

Sample a hemisphere using a cosine distribution to produce cosine weighted samples samples should be two random samples in range [0, 1) directions returned will be in the hemisphere around (0, 0, 1)

power_heuristic

Power heuristic for multiple importance sampling for two functions being sampled, f & g where beta is hard-coded to be two following PBR & Veach

uniform_cone_pdf

Return the PDF for uniformly sampling a cone with some max solid angle

uniform_sample_cone

Uniformly sample a direction in a cone with max angle cos_theta_max where the cone lies along the z-axis

uniform_sample_cone_frame

Uniformly sample a direction in a cone with max angle cos_theta_max where the cone looks down the w_z vector provided, with w_x, w_y forming the rest of the coordinate frame for the cone

uniform_sample_sphere

Uniformly sample a direction on the unit sphere about the origin