示例#1
0
        public override float Sample(Surfel surfel, out Vector3 wi, Vector2 sample, out float pdf)
        {
            float res;
            var   f = fresnel.Evaluate(Vector3.Dot(surfel.normal, surfel.ray));

            if (sample.X < f)
            {
                res = reflection.Sample(surfel, out wi, sample, out pdf);
                pdf = f;
            }
            else
            {
                res = transmission.Sample(surfel, out wi, sample, out pdf);
                pdf = 1 - f;
            }
            return(res);
        }
示例#2
0
 public override float Sample(Surfel surfel, out Vector3 wi, out float pdf)
 {
     return(brdf.Sample(surfel, out wi, Mathf.CreateSample(), out pdf));
 }