Exemple #1
0
        public void Clear()
        {
            iteration = 0;

            // zero out both average textures before accumulation
            GL.Ext.BindFramebuffer(FramebufferTarget.FramebufferExt, fboHandle);
            GL.FramebufferTexture2D(FramebufferTarget.FramebufferExt,
                                    FramebufferAttachment.DepthAttachmentExt, TextureTarget.Texture2D,
                                    currentFrameDepthTexture, 0);
            GL.FramebufferTexture2D(FramebufferTarget.FramebufferExt,
                                    FramebufferAttachment.ColorAttachment0Ext, TextureTarget.Texture2D,
                                    averageTexture, 0);

            LayerHelper.CheckFbo();

            GL.ClearColor(0, 0, 0, 1);
            GL.Clear(ClearBufferMask.ColorBufferBit);

            GL.FramebufferTexture2D(FramebufferTarget.FramebufferExt,
                                    FramebufferAttachment.ColorAttachment0Ext, TextureTarget.Texture2D,
                                    updatedAverageTexture, 0);

            GL.ClearColor(0, 0, 0, 1);
            GL.Clear(ClearBufferMask.ColorBufferBit);

            LayerHelper.CheckFbo();
        }