/// <summary> /// Performs the inverse of the projection done by <see cref="Sample"/> /// </summary> /// <param name="point">A point on the surface of this mesh</param> /// <returns>The primary sample space point that would have been projected there</returns> public Vector2 SampleInverse(SurfacePoint point) { var local = SampleWarp.FromUniformTriangle(point.BarycentricCoords); float x = triangleDistribution.SampleInverse((int)point.PrimId, local.X); return(new(x, local.Y)); }
/// <returns>The surface area pdf of sampling the given point on the surface of this mesh.</returns> public float Pdf(SurfacePoint point) { return(1.0f / SurfaceArea); }