コード例 #1
0
ファイル: DepthPeel.cs プロジェクト: xoxota99/Myre
        private static float EstimateError(Layer batch, IGeometry geometry, BoundingRectangle screenSpaceBounds)
        {
            float totalError = 0;
            foreach (var bound in batch.Overlaps(screenSpaceBounds))
            {
                var overlap = bound.Intersection(screenSpaceBounds);

                if (!overlap.HasValue)
                    continue;

                var size = overlap.Value.Max - overlap.Value.Min;
                totalError += size.X * size.Y;
            }

            return totalError;
        }