Ejemplo n.º 1
0
        /// <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));
        }
Ejemplo n.º 2
0
 /// <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);
 }