Exemple #1
0
        public void Prepare(int width, int height, int samples)
        {
            if (Width == width && Height == height && Samples == samples)
            {
                return;
            }

            Width   = width;
            Height  = height;
            Samples = samples;

            Framebuffer.Detach(FramebufferAttachmentPoint.Color0);
            Framebuffer.Detach(FramebufferAttachmentPoint.DepthStencil);

            ColorBuffer?.Dispose();
            DepthBuffer?.Dispose();
            ResolvedTex?.Dispose();

            ColorBuffer = infra.GlContext.Create.Renderbuffer(width, height, Format.Srgb8Alpha8, samples);
            DepthBuffer = infra.GlContext.Create.Renderbuffer(width, height, Format.Depth24Stencil8, samples);
            ResolvedTex = infra.GlContext.Create.Texture2D(width, height, GraphicsHelper.TextureMipCount(width, height), Format.Srgb8Alpha8);

            Framebuffer.AttachRenderbuffer(FramebufferAttachmentPoint.Color0, ColorBuffer);
            Framebuffer.AttachRenderbuffer(FramebufferAttachmentPoint.DepthStencil, DepthBuffer);
        }
Exemple #2
0
 public void Dispose()
 {
     resolveFramebuffer?.Dispose();
     Framebuffer?.Dispose();
     ColorBuffer?.Dispose();
     DepthBuffer?.Dispose();
     ResolvedTex?.Dispose();
 }
Exemple #3
0
        protected void Dispose(bool disposing)
        {
            if (disposing)
            {
                PositionBuffer?.Dispose();
                NormalBuffer?.Dispose();
                TangentBuffer?.Dispose();
                TexCoordBuffer?.Dispose();
                TexCoord2Buffer?.Dispose();
                ColorBuffer?.Dispose();

                foreach (var indexTable in IndexTables)
                {
                    indexTable.Dispose();
                }
            }

            GL.DeleteVertexArray(VertexArrayID);
        }
Exemple #4
0
 public void Dispose()
 {
     VoxelBuffer.Dispose();
     ColorBuffer.Dispose();
     NormalBuffer.Dispose();
 }