示例#1
0
        public bool prepare(Options options, Scene scene, int w, int h)
        {
            this.scene  = scene;
            imageWidth  = w;
            imageHeight = h;

            // fetch options
            bucketSize      = options.getInt("bucket.size", bucketSize);
            bucketOrderName = options.getstring("bucket.order", bucketOrderName);
            numSamples      = options.getInt("aa.samples", numSamples);
            shadingCache    = options.getbool("aa.cache", shadingCache);

            // limit bucket size and compute number of buckets in each direction
            bucketSize = MathUtils.clamp(bucketSize, 16, 512);
            int numBucketsX = (imageWidth + bucketSize - 1) / bucketSize;
            int numBucketsY = (imageHeight + bucketSize - 1) / bucketSize;

            bucketOrder  = BucketOrderFactory.create(bucketOrderName);
            bucketCoords = bucketOrder.getBucketSequence(numBucketsX, numBucketsY);
            // validate AA options
            numSamples    = Math.Max(1, numSamples);
            invNumSamples = 1.0f / numSamples;
            // prepare QMC sampling
            UI.printInfo(UI.Module.BCKT, "Multipass renderer settings:");
            UI.printInfo(UI.Module.BCKT, " * Resolution: {0}x{1}", imageWidth, imageHeight);
            UI.printInfo(UI.Module.BCKT, " * Bucket size: {0}", bucketSize);
            UI.printInfo(UI.Module.BCKT, " * Number of buckets: {0}x{1}", numBucketsX, numBucketsY);
            UI.printInfo(UI.Module.BCKT, " * Samples / pixel: {0}", numSamples);
            UI.printInfo(UI.Module.BCKT, " * Shading cache: {0}", shadingCache ? "enabled" : "disabled");
            return(true);
        }
示例#2
0
        public bool prepare(Options options, Scene scene, int w, int h)
        {
            this.scene = scene;
            imageWidth = w;
            imageHeight = h;

            // fetch options
            bucketSize = options.getInt("bucket.size", bucketSize);
            bucketOrderName = options.getstring("bucket.order", bucketOrderName);
            numSamples = options.getInt("aa.samples", numSamples);
            shadingCache = options.getbool("aa.cache", shadingCache);

            // limit bucket size and compute number of buckets in each direction
            bucketSize = MathUtils.clamp(bucketSize, 16, 512);
            int numBucketsX = (imageWidth + bucketSize - 1) / bucketSize;
            int numBucketsY = (imageHeight + bucketSize - 1) / bucketSize;
            bucketOrder = BucketOrderFactory.create(bucketOrderName);
            bucketCoords = bucketOrder.getBucketSequence(numBucketsX, numBucketsY);
            // validate AA options
            numSamples = Math.Max(1, numSamples);
            invNumSamples = 1.0f / numSamples;
            // prepare QMC sampling
            UI.printInfo(UI.Module.BCKT, "Multipass renderer settings:");
            UI.printInfo(UI.Module.BCKT, " * Resolution: {0}x{1}", imageWidth, imageHeight);
            UI.printInfo(UI.Module.BCKT, " * Bucket size: {0}", bucketSize);
            UI.printInfo(UI.Module.BCKT, " * Number of buckets: {0}x{1}", numBucketsX, numBucketsY);
            UI.printInfo(UI.Module.BCKT, " * Samples / pixel: {0}", numSamples);
            UI.printInfo(UI.Module.BCKT, " * Shading cache: {0}", shadingCache ? "enabled" : "disabled");
            return true;
        }
示例#3
0
        public bool Equals(DestinyInventoryBucketDefinition input)
        {
            if (input == null)
            {
                return(false);
            }

            return
                ((
                     DisplayProperties == input.DisplayProperties ||
                     (DisplayProperties != null && DisplayProperties.Equals(input.DisplayProperties))
                     ) &&
                 (
                     Scope == input.Scope ||
                     (Scope != null && Scope.Equals(input.Scope))
                 ) &&
                 (
                     Category == input.Category ||
                     (Category != null && Category.Equals(input.Category))
                 ) &&
                 (
                     BucketOrder == input.BucketOrder ||
                     (BucketOrder.Equals(input.BucketOrder))
                 ) &&
                 (
                     ItemCount == input.ItemCount ||
                     (ItemCount.Equals(input.ItemCount))
                 ) &&
                 (
                     Location == input.Location ||
                     (Location != null && Location.Equals(input.Location))
                 ) &&
                 (
                     HasTransferDestination == input.HasTransferDestination ||
                     (HasTransferDestination != null && HasTransferDestination.Equals(input.HasTransferDestination))
                 ) &&
                 (
                     Enabled == input.Enabled ||
                     (Enabled != null && Enabled.Equals(input.Enabled))
                 ) &&
                 (
                     Fifo == input.Fifo ||
                     (Fifo != null && Fifo.Equals(input.Fifo))
                 ) &&
                 (
                     Hash == input.Hash ||
                     (Hash.Equals(input.Hash))
                 ) &&
                 (
                     Index == input.Index ||
                     (Index.Equals(input.Index))
                 ) &&
                 (
                     Redacted == input.Redacted ||
                     (Redacted != null && Redacted.Equals(input.Redacted))
                 ));
        }
示例#4
0
        public static BucketOrder create(string order)
        {
            bool flip = false;

            if (order.StartsWith("inverse") || order.StartsWith("invert") || order.StartsWith("reverse"))
            {
                string[] tokens = order.Split(StringConsts.Whitespace, StringSplitOptions.RemoveEmptyEntries);//"\\s+");
                if (tokens.Length == 2)
                {
                    order = tokens[1];
                    flip  = true;
                }
            }
            BucketOrder o = null;

            if (order == "row")
            {
                o = new RowBucketOrder();
            }
            else if (order == "column")
            {
                o = new ColumnBucketOrder();
            }
            else if (order == "diagonal")
            {
                o = new DiagonalBucketOrder();
            }
            else if (order == "spiral")
            {
                o = new SpiralBucketOrder();
            }
            else if (order == "hilbert")
            {
                o = new HilbertBucketOrder();
            }
            else if (order == "random")
            {
                o = new RandomBucketOrder();
            }
            if (o == null)
            {
                UI.printWarning(UI.Module.BCKT, "Unrecognized bucket ordering: \"%s\" - using hilbert", order);
                return(new HilbertBucketOrder());
            }
            else
            {
                if (flip)
                {
                    o = new InvertedBucketOrder(o);
                }
                return(o);
            }
        }
示例#5
0
        public static BucketOrder create(string order)
        {
            bool flip = false;

            if (order.StartsWith("inverse") || order.StartsWith("invert") || order.StartsWith("reverse"))
            {
                string[] tokens = order.Split(StringConsts.Whitespace, StringSplitOptions.RemoveEmptyEntries);//"\\s+");
                if (tokens.Length == 2)
                {
                    order = tokens[1];
                    flip  = true;
                }
            }
            BucketOrder o = PluginRegistry.bucketOrderPlugins.createObject(order);

            if (o == null)
            {
                UI.printWarning(UI.Module.BCKT, "Unrecognized bucket ordering: \"{0}\" - using hilbert", order);
                return(create("hilbert"));
            }
            return(flip ? new InvertedBucketOrder(o) : o);
        }
示例#6
0
        public bool prepare(Options options, Scene scene, int w, int h)
        {
            this.scene = scene;
            imageWidth = w;
            imageHeight = h;

            // fetch options
            bucketSize = options.getInt("bucket.size", bucketSize);
            bucketOrderName = options.getstring("bucket.order", bucketOrderName);
            minAADepth = options.getInt("aa.min", minAADepth);
            maxAADepth = options.getInt("aa.max", maxAADepth);
            superSampling = options.getInt("aa.samples", superSampling);
            displayAA = options.getbool("aa.display", displayAA);
            jitter = options.getbool("aa.jitter", jitter);
            contrastThreshold = options.getFloat("aa.contrast", contrastThreshold);

            // limit bucket size and compute number of buckets in each direction
            bucketSize = MathUtils.clamp(bucketSize, 16, 512);
            int numBucketsX = (imageWidth + bucketSize - 1) / bucketSize;
            int numBucketsY = (imageHeight + bucketSize - 1) / bucketSize;
            bucketOrder = BucketOrderFactory.create(bucketOrderName);
            bucketCoords = bucketOrder.getBucketSequence(numBucketsX, numBucketsY);
            // validate AA options
            minAADepth = MathUtils.clamp(minAADepth, -4, 5);
            maxAADepth = MathUtils.clamp(maxAADepth, minAADepth, 5);
            superSampling = MathUtils.clamp(superSampling, 1, 256);
            invSuperSampling = 1.0 / superSampling;
            // compute AA stepping sizes
            subPixelSize = (maxAADepth > 0) ? (1 << maxAADepth) : 1;
            minStepSize = maxAADepth >= 0 ? 1 : 1 << (-maxAADepth);
            if (minAADepth == maxAADepth)
                maxStepSize = minStepSize;
            else
                maxStepSize = minAADepth > 0 ? 1 << minAADepth : subPixelSize << (-minAADepth);
            useJitter = jitter && maxAADepth > 0;
            // compute anti-aliasing contrast thresholds
            contrastThreshold = MathUtils.clamp(contrastThreshold, 0, 1);
            thresh = contrastThreshold * (float)Math.Pow(2.0f, minAADepth);
            // read filter settings from scene
            filterName = options.getstring("filter", filterName);
			filter = PluginRegistry.filterPlugins.createObject(filterName);
            // adjust filter
            if (filter == null)
            {
                UI.printWarning(UI.Module.BCKT, "Unrecognized filter type: \"{0}\" - defaulting to box", filterName);
                filter = new BoxFilter();
                filterName = "box";
            }
            fhs = filter.getSize() * 0.5f;
            fs = (int)Math.Ceiling(subPixelSize * (fhs - 0.5f));

            // prepare QMC sampling
			sigmaOrder = Math.Min(QMC.MAX_SIGMA_ORDER, Math.Max(0, maxAADepth) + 13); // FIXME: how big should the table be?
			sigmaLength = 1 << sigmaOrder;
            UI.printInfo(UI.Module.BCKT, "Bucket renderer settings:");
            UI.printInfo(UI.Module.BCKT, "  * Resolution:         {0}x{1}", imageWidth, imageHeight);
            UI.printInfo(UI.Module.BCKT, "  * Bucket size:        {0}", bucketSize);
            UI.printInfo(UI.Module.BCKT, "  * Number of buckets:  {0}x{1}", numBucketsX, numBucketsY);
            if (minAADepth != maxAADepth)
                UI.printInfo(UI.Module.BCKT, "  * Anti-aliasing:      {0} -> {1} (adaptive)", aaDepthTostring(minAADepth), aaDepthTostring(maxAADepth));
            else
                UI.printInfo(UI.Module.BCKT, "  * Anti-aliasing:      {0} (fixed)", aaDepthTostring(minAADepth));
            UI.printInfo(UI.Module.BCKT, "  * Rays per sample:    {0}", superSampling);
            UI.printInfo(UI.Module.BCKT, "  * Subpixel jitter:    {0}", useJitter ? "on" : (jitter ? "auto-off" : "off"));
            UI.printInfo(UI.Module.BCKT, "  * Contrast threshold: {0}", contrastThreshold);
            UI.printInfo(UI.Module.BCKT, "  * Filter type:        {0}", filterName);
            UI.printInfo(UI.Module.BCKT, "  * Filter size:        {0} pixels", filter.getSize());
            return true;
        }
示例#7
0
        public bool prepare(Options options, Scene scene, int w, int h)
        {
            this.scene  = scene;
            imageWidth  = w;
            imageHeight = h;

            // fetch options
            bucketSize        = options.getInt("bucket.size", bucketSize);
            bucketOrderName   = options.getstring("bucket.order", bucketOrderName);
            minAADepth        = options.getInt("aa.min", minAADepth);
            maxAADepth        = options.getInt("aa.max", maxAADepth);
            superSampling     = options.getInt("aa.samples", superSampling);
            displayAA         = options.getbool("aa.display", displayAA);
            jitter            = options.getbool("aa.jitter", jitter);
            contrastThreshold = options.getFloat("aa.contrast", contrastThreshold);

            // limit bucket size and compute number of buckets in each direction
            bucketSize = MathUtils.clamp(bucketSize, 16, 512);
            int numBucketsX = (imageWidth + bucketSize - 1) / bucketSize;
            int numBucketsY = (imageHeight + bucketSize - 1) / bucketSize;

            bucketOrder  = BucketOrderFactory.create(bucketOrderName);
            bucketCoords = bucketOrder.getBucketSequence(numBucketsX, numBucketsY);
            // validate AA options
            minAADepth       = MathUtils.clamp(minAADepth, -4, 5);
            maxAADepth       = MathUtils.clamp(maxAADepth, minAADepth, 5);
            superSampling    = MathUtils.clamp(superSampling, 1, 256);
            invSuperSampling = 1.0 / superSampling;
            // compute AA stepping sizes
            subPixelSize = (maxAADepth > 0) ? (1 << maxAADepth) : 1;
            minStepSize  = maxAADepth >= 0 ? 1 : 1 << (-maxAADepth);
            if (minAADepth == maxAADepth)
            {
                maxStepSize = minStepSize;
            }
            else
            {
                maxStepSize = minAADepth > 0 ? 1 << minAADepth : subPixelSize << (-minAADepth);
            }
            useJitter = jitter && maxAADepth > 0;
            // compute anti-aliasing contrast thresholds
            contrastThreshold = MathUtils.clamp(contrastThreshold, 0, 1);
            thresh            = contrastThreshold * (float)Math.Pow(2.0f, minAADepth);
            // read filter settings from scene
            filterName = options.getstring("filter", filterName);
            filter     = FilterFactory.get(filterName);
            // adjust filter
            if (filter == null)
            {
                UI.printWarning(UI.Module.BCKT, "Unrecognized filter type: \"{0}\" - defaulting to box", filterName);
                filter     = new BoxFilter(1);
                filterName = "box";
            }
            fhs = filter.getSize() * 0.5f;
            fs  = (int)Math.Ceiling(subPixelSize * (fhs - 0.5f));

            // prepare QMC sampling
            sigma = QMC.generateSigmaTable(subPixelSize << 7);
            UI.printInfo(UI.Module.BCKT, "Bucket renderer settings:");
            UI.printInfo(UI.Module.BCKT, "  * Resolution:         {0}x{1}", imageWidth, imageHeight);
            UI.printInfo(UI.Module.BCKT, "  * Bucket size:        {0}", bucketSize);
            UI.printInfo(UI.Module.BCKT, "  * Number of buckets:  {0}x{1}", numBucketsX, numBucketsY);
            if (minAADepth != maxAADepth)
            {
                UI.printInfo(UI.Module.BCKT, "  * Anti-aliasing:      {0} -> {1} (adaptive)", aaDepthTostring(minAADepth), aaDepthTostring(maxAADepth));
            }
            else
            {
                UI.printInfo(UI.Module.BCKT, "  * Anti-aliasing:      {0} (fixed)", aaDepthTostring(minAADepth));
            }
            UI.printInfo(UI.Module.BCKT, "  * Rays per sample:    {0}", superSampling);
            UI.printInfo(UI.Module.BCKT, "  * Subpixel jitter:    {0}", useJitter ? "on" : (jitter ? "auto-off" : "off"));
            UI.printInfo(UI.Module.BCKT, "  * Contrast threshold: {0}", contrastThreshold);
            UI.printInfo(UI.Module.BCKT, "  * Filter type:        {0}", filterName);
            UI.printInfo(UI.Module.BCKT, "  * Filter size:        {0} pixels", filter.getSize());
            return(true);
        }
示例#8
0
 public InvertedBucketOrder(BucketOrder order)
 {
     this.order = order;
 }
示例#9
0
 public InvertedBucketOrder(BucketOrder order)
 {
     this.order = order;
 }