CreateColorbuffer() публичный статический Метод

public static CreateColorbuffer ( int width, int height, uint internalFormat = OpenGL.GL_RGBA ) : Renderbuffer
width int
height int
internalFormat uint
Результат Renderbuffer
Пример #1
0
        private Framebuffer CreateFramebuffer(int width, int height)
        {
            var texture = new Texture(TextureTarget.Texture2D,
                                      new NullImageFiller(width, height, GL.GL_RGBA, GL.GL_RGBA, GL.GL_UNSIGNED_BYTE),
                                      new SamplerParameters(
                                          TextureWrapping.Repeat,
                                          TextureWrapping.Repeat,
                                          TextureWrapping.Repeat,
                                          TextureFilter.Linear,
                                          TextureFilter.Linear));

            texture.Initialize();
            this.BindingTexture = texture;
            Renderbuffer colorBuffer = Renderbuffer.CreateColorbuffer(width, height, GL.GL_RGBA);
            Renderbuffer depthBuffer = Renderbuffer.CreateDepthbuffer(width, height, DepthComponentType.DepthComponent24);
            var          framebuffer = new Framebuffer();

            framebuffer.Bind();
            framebuffer.Attach(colorBuffer);                         //0
            framebuffer.Attach(texture);                             //1
            framebuffer.Attach(depthBuffer);                         // special
            framebuffer.SetDrawBuffers(GL.GL_COLOR_ATTACHMENT0 + 1); // as in 1 in framebuffer.Attach(texture);//1
            framebuffer.CheckCompleteness();
            framebuffer.Unbind();
            return(framebuffer);
        }
Пример #2
0
        private Framebuffer CreatePickFramebuffer(int width, int height)
        {
            Renderbuffer colorBuffer = Renderbuffer.CreateColorbuffer(width, height, GL.GL_RGBA);
            Renderbuffer depthBuffer = Renderbuffer.CreateDepthbuffer(width, height, DepthComponentType.DepthComponent24);
            var          framebuffer = new Framebuffer();

            framebuffer.Bind();
            framebuffer.Attach(colorBuffer);
            framebuffer.Attach(depthBuffer);
            framebuffer.CheckCompleteness();
            framebuffer.Unbind();

            return(framebuffer);
        }
Пример #3
0
        private Renderbuffer AttachColorbuffer(FramebufferTarget target)
        {
            if (nextColorAttachmentIndex >= attachment_id.Length)
            {
                throw new IndexOutOfRangeException("Not enough attach points!");
            }

            Renderbuffer colorBuffer = Renderbuffer.CreateColorbuffer(this.Width, this.Height, GL.GL_RGBA);

            glFramebufferRenderbuffer((uint)target, attachment_id[nextColorAttachmentIndex++], GL.GL_RENDERBUFFER, colorBuffer.Id);

            this.colorBufferList.Add(colorBuffer);

            return(colorBuffer);
        }