예제 #1
0
        public double GetIntensity(Vector4 point, World w)
        {
            var total = 0.0;

            for (var v = 0; v < this.Vsteps; v++)
            {
                for (var u = 0; u < this.Usteps; u++)
                {
                    var lightPos = this.GetPoint(u, v);
                    if (!w.IsShadowed(lightPos, point))
                    {
                        total = total + 1.0;
                    }
                }
            }

            return(total / this.Samples);
        }
예제 #2
0
파일: PointLight.cs 프로젝트: basp/pixie
        public double GetIntensity(Vector4 point, World w)
        {
            var shadow = w.IsShadowed(this.Position, point);

            return(shadow ? 0.0 : 1.0);
        }