public virtual void Init(uint width, uint height) { FrameBufferAttachmentInfo[] infos = new FrameBufferAttachmentInfo[] { new FrameBufferAttachmentInfo { internalFormat = Gl.GL_RGB32F, format = Gl.GL_RGB, attachment = Gl.GL_COLOR_ATTACHMENT0 }, new FrameBufferAttachmentInfo { internalFormat = Gl.GL_RGB32F, format = Gl.GL_RGB, attachment = Gl.GL_COLOR_ATTACHMENT1 }, new FrameBufferAttachmentInfo { internalFormat = Gl.GL_RGB32F, format = Gl.GL_RGB, attachment = Gl.GL_COLOR_ATTACHMENT2 }, new FrameBufferAttachmentInfo { internalFormat = Gl.GL_RGB32F, format = Gl.GL_RGB, attachment = Gl.GL_COLOR_ATTACHMENT3 }, new FrameBufferAttachmentInfo { internalFormat = Gl.GL_RGB32F, format = Gl.GL_RGB, attachment = Gl.GL_COLOR_ATTACHMENT4 }, new FrameBufferAttachmentInfo { internalFormat = Gl.GL_DEPTH_COMPONENT32F, format = Gl.GL_DEPTH_COMPONENT, attachment = Gl.GL_DEPTH_ATTACHMENT }, }; Init(infos, width, height); }
public void Init(int colorBufferCount, bool hasDepth, uint width, uint height) { int textureCount = hasDepth ? colorBufferCount + 1 : colorBufferCount; FrameBufferAttachmentInfo[] attachmentInfos = new FrameBufferAttachmentInfo[textureCount]; for (int i = 0; i < colorBufferCount; i++) { attachmentInfos[i] = new FrameBufferAttachmentInfo { internalFormat = Gl.GL_RGB32F, format = Gl.GL_RGB, attachment = Gl.GL_COLOR_ATTACHMENT0 + i, } } ; if (hasDepth) { attachmentInfos[textureCount - 1] = new FrameBufferAttachmentInfo { internalFormat = Gl.GL_DEPTH_COMPONENT32F, format = Gl.GL_DEPTH_COMPONENT, attachment = Gl.GL_DEPTH_ATTACHMENT } } ; Init(attachmentInfos, width, height); } }
public void Init(uint width, uint height) { FrameBufferAttachmentInfo[] infos = new FrameBufferAttachmentInfo[] { new FrameBufferAttachmentInfo { internalFormat = Gl.GL_DEPTH_COMPONENT32F, format = Gl.GL_DEPTH_COMPONENT, attachment = Gl.GL_DEPTH_ATTACHMENT }, }; Init(infos, width, height); }