Beispiel #1
0
        protected override void Render(IShader11 shader)
        {
            Renderer.Render(Target.Texture, shader);

            DisposeHelper.DisposeElements(m_Buffers);
            m_Buffers.Clear();
        }
        public override void Render()
        {
            Renderer.Render(Target, Shader);

            DisposeHelper.DisposeElements(m_Buffers);
            m_Buffers.Clear();
        }
Beispiel #3
0
        protected sealed override void RenderOutput(ITargetTexture output)
        {
            Render(output);

            DisposeHelper.DisposeElements(m_Buffers);
            m_Buffers.Clear();
        }
Beispiel #4
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing)
            {
                return;
            }

            DisposeHelper.DisposeElements(ref m_OriginalInputFilters);
            DisposeHelper.DisposeElements(InputFilters);
            DisposeHelper.Dispose(m_Output);
            InputFilters = null;
        }
Beispiel #5
0
        protected virtual void Dispose(bool disposing)
        {
            if (!disposing || IsDisposed)
            {
                return;
            }

            DisposeHelper.DisposeElements(m_InputFilters);
            DisposeHelper.DisposeElements(ref m_CompiledFilters);
            DisposeHelper.Dispose(m_Output);

            IsDisposed = true;
        }
Beispiel #6
0
        public static void FlushTextures()
        {
            DisposeHelper.DisposeElements(s_OldTextures);

            foreach (var texture in s_TempTextures)
            {
                s_SavedTextures.Remove(texture);
            }

            s_OldTextures.Clear();
            s_OldTextures.AddRange(s_SavedTextures);

            s_TempTextures.Clear();
            s_SavedTextures.Clear();
        }
            protected void CreateWeights(TextureSize sourceSize, TextureSize targetSize)
            {
                DisposeHelper.DisposeElements(ref m_Weights);

                double scaleFactorX = GetScaleFactor(targetSize.Width, sourceSize.Width);
                double scaleFactorY = GetScaleFactor(targetSize.Height, sourceSize.Height);

                var tapCount = TapCount.ToInt();
                int lobes    = tapCount / 2;

                m_Weights = new IManagedTexture <ISourceTexture> [lobes];
                var dataPointsX = GetDataPointCount(scaleFactorX);
                var dataPointsY = GetDataPointCount(scaleFactorY);
                var channels    = lobes == 2 ? 2 : 4;
                var data        = new Half[dataPointsY, dataPointsX *channels];

                for (int z = 0; z < lobes; z++)
                {
                    for (int y = 0; y < dataPointsY; y++)
                    {
                        for (int x = 0; x < dataPointsX; x++)
                        {
                            var offsetX = x / (double)dataPointsX;
                            var offsetY = y / (double)dataPointsX;

                            for (int i = 0; i < lobes; i++)
                            {
                                var distance = GetDistance(i + offsetX, z + offsetY);
                                data[y, x *channels + i] = GetWeight(distance, tapCount);
                            }
                        }
                    }
                    var weight = Renderer.CreateTexture(dataPointsX, dataPointsY,
                                                        channels == 2 ? TextureFormat.Float16_RG : TextureFormat.Float16);
                    Renderer.UpdateTexture(weight, data);
                    m_Weights[z] = weight.GetManaged();
                }
            }