private void DestroyFramebuffers() { if (framebuffer != null) { framebuffer.Dispose(); framebuffer = null; } }
public void Dispose() { resolveFramebuffer?.Dispose(); Framebuffer?.Dispose(); ColorBuffer?.Dispose(); DepthBuffer?.Dispose(); ResolvedTex?.Dispose(); }
protected override void Dispose(bool disposing) { if (disposing && !this._disposedValue) { _fbo.Dispose(); _coord_ssbo.Dispose(); _compute_prog.Dispose(); this._disposedValue = true; } base.Dispose(disposing); }
public void CleanupWindowSizeResources() { if (linear != null) { linear.Dispose(); linear = null; } if (multisampleResolve != null) { multisampleResolve.Dispose(); multisampleResolve = null; } }
public void SetLightCount(int n) { if (n == currentLightCount) { return; } currentLightCount = n; // \todo if n < currentLightCount ? if (RenderStack.Graphics.Configuration.useGl1 == true) { return; } if (shadow != null) { shadow.Dispose(); } shadow = FramebufferFactory.Create(Configuration.shadowResolution, Configuration.shadowResolution); if (example.Renderer.Configuration.hardwareShadowPCF) { shadowAttachment = FramebufferAttachment.DepthAttachment; var texture = shadow.AttachTextureArray( FramebufferAttachment.DepthAttachment, PixelFormat.DepthComponent, PixelInternalFormat.DepthComponent, n ); } else { shadowAttachment = FramebufferAttachment.ColorAttachment0; if ( (RenderStack.Graphics.Configuration.canUseTextureArrays) && (RenderStack.Graphics.Configuration.glslVersion >= 330) ) { shadow.AttachTextureArray( FramebufferAttachment.ColorAttachment0, PixelFormat.Red, //PixelInternalFormat.R16f, PixelInternalFormat.R32f, n ); } else { shadow.AttachTexture( FramebufferAttachment.ColorAttachment0, PixelFormat.Red, //PixelInternalFormat.R16f, PixelInternalFormat.R32f ); } shadow.AttachRenderBuffer( FramebufferAttachment.DepthAttachment, //PixelFormat.DepthComponent, RenderbufferStorage.DepthComponent32, 0 ); } shadow.Begin(); shadow.Check(); shadow.End(); var noShadow = materialManager.Textures["NoShadow"] = new TextureGL( 1, 1, PixelFormat.Red, PixelInternalFormat.R16f, n ); System.Single[] whiteData = new System.Single[n]; for (int i = 0; i < n; ++i) { whiteData[i] = 1.0f; } noShadow.Upload(whiteData, 0); }