AttachColorBuffer() public method

public AttachColorBuffer ( GLTexture2D colorbuffer, ColorBufferAttachPoint attachPosition ) : void
colorbuffer GLTexture2D
attachPosition ColorBufferAttachPoint
return void
示例#1
0
        public DCTProcessor(GraphicsInterface gi, int width, int height)
        {
            fGI = gi;
            fWidth = width;
            fHeight = height;

            // Create the cosine buffer
            // Calculate the cosines
            // assign the values to the texture object
            fCosineBuffer = new GLTextureRectangle(gi, 8, 8, TextureInternalFormat.Luminance, TexturePixelFormat.Luminance, PixelType.Float);

            fRenderTarget = new GLRenderTarget(gi, width, height);
            fDCTOutputTexture = new GLTextureRectangle(gi, width, height, TextureInternalFormat.Rgba, TexturePixelFormat.Rgba, PixelType.Float);

            // We attach the texture 4 times so we can output to the same texture four times
            // in one shader pass using gl_FragData[0,1,2,3]
            fRenderTarget.AttachColorBuffer(fDCTOutputTexture, ColorBufferAttachPoint.Position0);
            fRenderTarget.AttachColorBuffer(fDCTOutputTexture, ColorBufferAttachPoint.Position1);
            fRenderTarget.AttachColorBuffer(fDCTOutputTexture, ColorBufferAttachPoint.Position2);
            fRenderTarget.AttachColorBuffer(fDCTOutputTexture, ColorBufferAttachPoint.Position3);
            fRenderTarget.Unbind();

            // Precalculate the basis functions (cosine tables)

        }
示例#2
0
        public YCrCbProcessor(GraphicsInterface gi, int width, int height)
        {
            fGI = gi;

            fWidth = width;
            fHeight = height;

            // Create the texture objects that will receive the output
            fYTexture = new GLTexture2D(GI, width, height, TextureInternalFormat.Luminance, TexturePixelFormat.Luminance, PixelType.Byte, IntPtr.Zero, false);
            fCrTexture = new GLTexture2D(GI, width, height, TextureInternalFormat.Luminance, TexturePixelFormat.Luminance, PixelType.Byte, IntPtr.Zero, false);
            fCbTexture = new GLTexture2D(GI, width, height, TextureInternalFormat.Luminance, TexturePixelFormat.Luminance, PixelType.Byte, IntPtr.Zero, false);

            // Setup the render target that has 3 color channels for Multi Render Target
            // output in a shader using gl_FragData[n]
            fYCrCbTarget = new GLRenderTarget(GI);
            fYCrCbTarget.AttachColorBuffer(fYTexture, ColorBufferAttachPoint.Position0);
            fYCrCbTarget.AttachColorBuffer(fCrTexture, ColorBufferAttachPoint.Position1);
            fYCrCbTarget.AttachColorBuffer(fCbTexture, ColorBufferAttachPoint.Position2);
            fYCrCbTarget.Unbind();

            // Create the shader program that does the actual separation
            fYCrCbChannelSep = GLSLShaderProgram.CreateUsingVertexAndFragmentStrings(GI, FixedVert, YCrCb_Frag);
        }
示例#3
0
        public DissolveProcessor(GraphicsInterface gi, int width, int height, float noiseScale)
        {
            fGI = gi;

            fWidth = width;
            fHeight = height;
            fNoiseScale = noiseScale;

            // Create the texture objects that will receive the output
            fOutputTexture = new GLTexture2D(GI, width, height, TextureInternalFormat.Rgba, TexturePixelFormat.Bgr, PixelComponentType.Byte, IntPtr.Zero, false);
            // Setup the render target that has 3 color channels for Multi Render Target
            // output in a shader using gl_FragData[n]
            fOutputTarget = new GLRenderTarget(GI);
            fOutputTarget.AttachColorBuffer(fOutputTexture, ColorBufferAttachPoint.Position0);
            fOutputTarget.Unbind();

            // Create the shader program that does the actual separation
            fDissolveShader = GLSLShaderProgram.CreateUsingVertexAndFragmentStrings(GI, FixedVert, Dissolve_Frag);
        }