protected void Init(IIntersectionEngine device, bool lowLatency, IImageFilm pixelDevice, ISampler sampler,
                            SurfaceSampler ss)
        {
            this.intersectionDevice = device;
            // Sample buffer
            var sampleBufferSize = lowLatency ? (this.SAMPLE_BUFFER_SIZE / 4) : this.SAMPLE_BUFFER_SIZE;
            this.sampleBuffer = new SampleBuffer(sampleBufferSize);

            this.width = sampler.Width;
            this.height = sampler.Height;
            var rayBufferSize = lowLatency ? (RayBuffer.RayBufferSize / 8) : RayBuffer.RayBufferSize;
            this.sampler = sampler;
            this._pathRayProcessors = new PathBufferBase[DeviceRenderBufferCount];
            this.rayBuffers = new RayBuffer[DeviceRenderBufferCount];
            this.pixelDevice = pixelDevice;
            for (int i = 0; i < DeviceRenderBufferCount; i++)
            {
                this.rayBuffers[i] = new RayBuffer(rayBufferSize);
                this.rayBuffers[i].UserData = this.threadIndex;

                this._pathRayProcessors[i] = this.CreatePathBuffer(this.scene.MaxPaths, this.scene, pixelDevice, sampler, ss);
                this._pathRayProcessors[i].ThreadId = this.threadIndex;
            }

            this.renderThread = null;
        }
Example #2
0
        protected void Init(IIntersectionEngine device, bool lowLatency, ImageFilmBase pixelDevice, IPrimarySpaceSampler sampler,
                          SurfaceSampler ss)
        {
            intersectionDevice = device;
            // Sample buffer
            var sampleBufferSize = lowLatency ? (SAMPLE_BUFFER_SIZE / 4) : SAMPLE_BUFFER_SIZE;
            sampleBuffer = new SampleBuffer(sampleBufferSize);

            width = sampler.Width;
            height = sampler.Height;
            var rayBufferSize = lowLatency ? (RayBuffer.RayBufferSize / 8) : RayBuffer.RayBufferSize;
            this.sampler = sampler;
            _pathRayProcessors = new PathIntegrator[DeviceRenderBufferCount];
            rayBuffers = new RayBuffer[DeviceRenderBufferCount];

            for (int i = 0; i < DeviceRenderBufferCount; i++)
            {
                rayBuffers[i] = new RayBuffer(rayBufferSize);
                rayBuffers[i].UserData = threadIndex;

                _pathRayProcessors[i] = this.CreatePathBuffer(scene.MaxPaths, scene, pixelDevice, sampler, ss);
            }

            renderThread = null;
        }
        private void Init(IIntersectionEngine device, bool lowLatency, CorrectorImageFilm pixelDevice, GlobalSamplingContext sc)
        {
            this.samplers = sc;
            intersectionDevice = device;
            width = pixelDevice.Width;
            height = pixelDevice.Height;
            var rayBufferSize = lowLatency ? (RayBuffer.RayBufferSize / 8) : RayBuffer.RayBufferSize;
            rayBuffers = new RayBuffer[DeviceRenderBufferCount];
            this.pixelDevice = pixelDevice;
            for (int i = 0; i < DeviceRenderBufferCount; i++)
            {
                rayBuffers[i] = new RayBuffer(rayBufferSize);
                rayBuffers[i].UserData = threadIndex;
            }
            _pathRayProcessors = new PathSampleProcessor(scene.MaxPaths, (RayEngineScene)scene, pixelDevice, samplers);
            //_pathRayProcessors.RequestSamplesFunc = (f)=>{ GenerateIm}


            renderThread = null;
        }