コード例 #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);
        }