예제 #1
0
        public override float Lambda(Vector3 <float> w)
        {
            var absTanTheta = Math.Abs(BxDF.TanTheta(w));

            if (float.IsInfinity(absTanTheta))
            {
                return(0);
            }

            var alpha           = MathF.Sqrt(BxDF.Cos2Phi(w) * alphaX * alphaX + BxDF.Sin2Phi(w) * alphaY * alphaY);
            var alpha2Tan2Theta = (alpha * absTanTheta) * (alpha * absTanTheta);

            return((-1 + MathF.Sqrt(1 + alpha2Tan2Theta)) / 2.0f);
        }
예제 #2
0
        public override float Lambda(Vector3 <float> w)
        {
            var absTanTheta = Math.Abs(BxDF.TanTheta(w));

            if (float.IsInfinity(absTanTheta))
            {
                return(0);
            }

            var alpha = MathF.Sqrt(BxDF.Cos2Phi(w) * alphaX * alphaX + BxDF.Sin2Phi(w) * alphaY * alphaY);
            var a     = 1.0f / (alpha / absTanTheta);

            if (a >= 1.6f)
            {
                return(0);
            }

            return((1 - 1.259f * a + 0.396f * a * a) / (3.535f * a + 2.181f * a * a));
        }