Beispiel #1
0
        public WaveSpectrumBufferGPU(int size, Shader fourierSdr, int numBuffers)
        {
            if (numBuffers < 1 || numBuffers > 4)
            {
                throw new InvalidOperationException("Number of buffers is " + numBuffers + " but must be between (inclusive) 1 and 4");
            }


            m_buffers = new Buffer[numBuffers];

            m_fourier = new FourierGPU(size, fourierSdr);

            //Temporary arrays to reduce allocations.
            m_tmpList    = new List <RenderTexture>();
            m_tmpBuffer2 = new RenderBuffer[2];
            m_tmpBuffer3 = new RenderBuffer[3];
            m_tmpBuffer4 = new RenderBuffer[4];

            m_offset = new Vector4(1.0f + 0.5f / Size, 1.0f + 0.5f / Size, 0, 0);

            for (int i = 0; i < numBuffers; i++)
            {
                m_buffers[i] = CreateBuffer(size);
            }

            m_enabledData = new List <RenderTexture[]>();
            UpdateEnabledData();

            m_bufferName = "Ceto Wave Spectrum GPU Buffer";
        }
Beispiel #2
0
 public WaveSpectrumBufferGPU(int size, Shader fourierSdr, int numBuffers)
 {
     if (numBuffers < 1 || numBuffers > 4)
     {
         throw new InvalidOperationException("Number of buffers is " + numBuffers + " but must be between (inclusive) 1 and 4");
     }
     this.m_buffers    = new WaveSpectrumBufferGPU.Buffer[numBuffers];
     this.m_fourier    = new FourierGPU(size, fourierSdr);
     this.m_tmpList    = new List <RenderTexture>();
     this.m_tmpBuffer2 = new RenderBuffer[2];
     this.m_tmpBuffer3 = new RenderBuffer[3];
     this.m_tmpBuffer4 = new RenderBuffer[4];
     this.m_offset     = new Vector4(1f + 0.5f / (float)this.Size, 1f + 0.5f / (float)this.Size, 0f, 0f);
     for (int i = 0; i < numBuffers; i++)
     {
         this.m_buffers[i] = this.CreateBuffer(size);
     }
     this.m_enabledData = new List <RenderTexture[]>();
     this.UpdateEnabledData();
     this.m_bufferName = "Ceto Wave Spectrum GPU Buffer";
 }
 public WaveSpectrumBufferGPU(int size, Shader fourierSdr, int numBuffers)
 {
     if (numBuffers < 1 || numBuffers > 4)
     {
         throw new InvalidOperationException("Number of buffers is " + numBuffers + " but must be between (inclusive) 1 and 4");
     }
     this.m_buffers = new WaveSpectrumBufferGPU.Buffer[numBuffers];
     this.m_fourier = new FourierGPU(size, fourierSdr);
     this.m_tmpList = new List<RenderTexture>();
     this.m_tmpBuffer2 = new RenderBuffer[2];
     this.m_tmpBuffer3 = new RenderBuffer[3];
     this.m_tmpBuffer4 = new RenderBuffer[4];
     this.m_offset = new Vector4(1f + 0.5f / (float)this.Size, 1f + 0.5f / (float)this.Size, 0f, 0f);
     for (int i = 0; i < numBuffers; i++)
     {
         this.m_buffers[i] = this.CreateBuffer(size);
     }
     this.m_enabledData = new List<RenderTexture[]>();
     this.UpdateEnabledData();
     this.m_bufferName = "Ceto Wave Spectrum GPU Buffer";
 }
        public WaveSpectrumBufferGPU(int size, Shader fourierSdr, int numBuffers)
        {
            if(numBuffers < 1 || numBuffers > 4)
                throw new InvalidOperationException("Number of buffers is " + numBuffers + " but must be between (inclusive) 1 and 4");

            m_buffers = new Buffer[numBuffers];

            m_fourier = new FourierGPU(size, fourierSdr);

            m_tmpList = new List<RenderTexture>();

            m_offset = new Vector4(1.0f + 0.5f / Size, 1.0f + 0.5f / Size, 0, 0);

            for(int i = 0; i < numBuffers; i++)
            {
                m_buffers[i] = CreateBuffer(size);
            }

            m_enabledData = new List<RenderTexture[]>();
            UpdateEnabledData();

            m_bufferName = "Ceto Wave Spectrum GPU Buffer";
        }