CheckCompleteness() public method

check completeness.
public CheckCompleteness ( ) : bool
return bool
コード例 #1
0
ファイル: RTTHelper.cs プロジェクト: jonnyOntheroad/CSharpGL
        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 CreateFramebuffer(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(width, height);

            framebuffer.Bind();
            //framebuffer.Attach(colorBuffer);//0
            //this.BindingTexture = framebuffer.Attach(TextureAttachment.DepthAttachment);//1
            var texture = new Texture(new TexImage2D(TexImage2D.Target.Texture2D, GL.GL_DEPTH_COMPONENT32, width, height, GL.GL_DEPTH_COMPONENT, GL.GL_FLOAT),
                                      // 设置默认滤波模式
                                      new TexParameteri(TexParameter.PropertyName.TextureMinFilter, (int)GL.GL_LINEAR),
                                      new TexParameteri(TexParameter.PropertyName.TextureMagFilter, (int)GL.GL_LINEAR),
                                      // 设置深度比较模式
                                      new TexParameteri(TexParameter.PropertyName.TextureCompareMode, (int)GL.GL_COMPARE_REF_TO_TEXTURE),
                                      new TexParameteri(TexParameter.PropertyName.TextureCompareFunc, (int)GL.GL_LEQUAL),
                                      // 设置边界截取模式
                                      new TexParameteri(TexParameter.PropertyName.TextureWrapS, (int)GL.GL_CLAMP_TO_EDGE),
                                      new TexParameteri(TexParameter.PropertyName.TextureWrapT, (int)GL.GL_CLAMP_TO_EDGE));

            texture.Initialize();
            framebuffer.Attach(FramebufferTarget.Framebuffer, texture, AttachmentLocation.Depth);
            this.BindingTexture = texture;

            //framebuffer.Attach(depthBuffer);// special
            //framebuffer.SetDrawBuffers(GL.GL_COLOR_ATTACHMENT0 + 1);// as in 1 in framebuffer.Attach(texture);//1
            //framebuffer.SetDrawBuffers(GL.GL_NONE);
            framebuffer.SetDrawBuffer(GL.GL_NONE);
            //framebuffer.SetReadBuffer(GL.GL_NONE);
            this.BindingTexture.Bind();
            framebuffer.CheckCompleteness();
            this.BindingTexture.Unbind();
            framebuffer.Unbind();
            return(framebuffer);
        }
コード例 #3
0
        private Framebuffer CreateFramebuffer(int width, int height)
        {
            var framebuffer = new Framebuffer(width, height);

            framebuffer.Bind();
            {
                var texture = new Texture(new TexImageBitmap(width, height),
                                          new TexParameteri(TexParameter.PropertyName.TextureWrapS, (int)GL.GL_REPEAT),
                                          new TexParameteri(TexParameter.PropertyName.TextureWrapT, (int)GL.GL_REPEAT),
                                          new TexParameteri(TexParameter.PropertyName.TextureWrapR, (int)GL.GL_REPEAT),
                                          new TexParameteri(TexParameter.PropertyName.TextureMinFilter, (int)GL.GL_LINEAR),
                                          new TexParameteri(TexParameter.PropertyName.TextureMagFilter, (int)GL.GL_LINEAR));
                texture.Initialize();
                framebuffer.Attach(FramebufferTarget.Framebuffer, texture, 0u);// 1
                this.BindingTexture = texture;
            }
            {
                var renderbuffer = new Renderbuffer(width, height, GL.GL_DEPTH_COMPONENT24);
                framebuffer.Attach(FramebufferTarget.Framebuffer, renderbuffer, AttachmentLocation.Depth);// special
            }
            //framebuffer.SetDrawBuffer(GL.GL_COLOR_ATTACHMENT0 + 1);// as in 1 in framebuffer.Attach(FramebufferTarget.Framebuffer, texture, 1u);// 1
            framebuffer.CheckCompleteness();
            framebuffer.Unbind();

            return(framebuffer);
        }
コード例 #4
0
ファイル: PickingAction.cs プロジェクト: tfart/CSharpGL
        private Framebuffer CreatePickFramebuffer(int width, int height)
        {
            var framebuffer = new Framebuffer(width, height);

            framebuffer.Bind();
            framebuffer.Attach(RenderbufferType.ColorBuffer);
            framebuffer.Attach(RenderbufferType.DepthBuffer);
            framebuffer.CheckCompleteness();
            framebuffer.Unbind();

            return(framebuffer);
        }
コード例 #5
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);
        }
コード例 #6
0
        private Framebuffer CreateFramebuffer(int width, int height)
        {
            var framebuffer = new Framebuffer(width, height);

            framebuffer.Bind();
            Renderbuffer colorbuffer = framebuffer.Attach(RenderbufferType.ColorBuffer);      //0
            Texture      texture     = framebuffer.Attach(TextureAttachment.ColorAttachment); //1
            Renderbuffer depthbuffer = framebuffer.Attach(RenderbufferType.DepthBuffer);      // special

            framebuffer.SetDrawBuffer(GL.GL_COLOR_ATTACHMENT0 + 1);                           // as in 1 in framebuffer.Attach(TextureAttachment.ColorAttachment);//1
            framebuffer.CheckCompleteness();
            framebuffer.Unbind();

            this.BindingTexture = texture;

            return(framebuffer);
        }
コード例 #7
0
        private static Framebuffer CreateFramebuffer(int width, int height)
        {
            var framebuffer = new Framebuffer(width, height);
            framebuffer.Bind();
            {
                var renderbuffer = new Renderbuffer(width, height, GL.GL_RGBA, RenderbufferType.ColorBuffer);
                framebuffer.Attach(FramebufferTarget.Framebuffer, renderbuffer, 0u);// 0
            }
            {
                var renderbuffer = new Renderbuffer(width, height, GL.GL_DEPTH_COMPONENT24, RenderbufferType.DepthBuffer);
                framebuffer.Attach(FramebufferTarget.Framebuffer, renderbuffer, AttachmentLocation.Depth);// special
            }
            framebuffer.CheckCompleteness();
            framebuffer.Unbind();

            return framebuffer;
        }
コード例 #8
0
ファイル: PickingAction.cs プロジェクト: skyformat99/CSharpGL
        private Framebuffer CreatePickFramebuffer(int width, int height)
        {
            var framebuffer = new Framebuffer(width, height);

            framebuffer.Bind();
            {
                var renderbuffer = new Renderbuffer(width, height, GL.GL_RGBA);
                // attach the renderbufer as first color buffer attachment.
                const uint colorAttachmentLocation = 0;
                framebuffer.Attach(FramebufferTarget.Framebuffer, renderbuffer, colorAttachmentLocation);
            }
            {
                var renderbuffer = new Renderbuffer(width, height, GL.GL_DEPTH_COMPONENT24);
                framebuffer.Attach(FramebufferTarget.Framebuffer, renderbuffer, AttachmentLocation.Depth);// special
            }
            framebuffer.CheckCompleteness();
            framebuffer.Unbind();

            return(framebuffer);
        }
コード例 #9
0
        private Framebuffer CreateFramebuffer(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(width, height);

            framebuffer.Bind();
            //framebuffer.Attach(colorBuffer);//0
            this.BindingTexture = framebuffer.Attach(TextureAttachment.DepthAttachment);//1
            //framebuffer.Attach(depthBuffer);// special
            //framebuffer.SetDrawBuffers(GL.GL_COLOR_ATTACHMENT0 + 1);// as in 1 in framebuffer.Attach(texture);//1
            //framebuffer.SetDrawBuffers(GL.GL_NONE);
            framebuffer.SetDrawBuffer(GL.GL_NONE);
            //framebuffer.SetReadBuffer(GL.GL_NONE);
            this.BindingTexture.Bind();
            framebuffer.CheckCompleteness();
            this.BindingTexture.Unbind();
            framebuffer.Unbind();
            return(framebuffer);
        }
コード例 #10
0
        private static Framebuffer CreateFramebuffer(int width, int height, ContextGenerationParams parameters)
        {
            var framebuffer = new Framebuffer(width, height);

            framebuffer.Bind();
            {
                var  renderbuffer            = new Renderbuffer(width, height, GL.GL_RGBA);
                uint colorAttachmentLocation = 0;
                framebuffer.Attach(FramebufferTarget.Framebuffer, renderbuffer, colorAttachmentLocation);// 0
            }
            {
                var renderbuffer = new Renderbuffer(width, height, GL.GL_DEPTH_COMPONENT24);
                framebuffer.Attach(FramebufferTarget.Framebuffer, renderbuffer, AttachmentLocation.Depth);// special
            }
            if (parameters.StencilBits > 0)
            {
                var renderbuffer = new Renderbuffer(width, height, GL.GL_STENCIL_INDEX8);
                framebuffer.Attach(FramebufferTarget.Framebuffer, renderbuffer, AttachmentLocation.Stencil);
            }
            framebuffer.CheckCompleteness();
            framebuffer.Unbind();

            return(framebuffer);
        }
コード例 #11
0
        private static Framebuffer CreateFramebuffer(int width, int height)
        {
            Renderbuffer colorBuffer = Renderbuffer.CreateColorbuffer(width, height, OpenGL.GL_RGBA);
            Renderbuffer depthBuffer = Renderbuffer.CreateDepthbuffer(width, height, DepthComponentType.DepthComponent24);
            var framebuffer = new Framebuffer();
            framebuffer.Bind();
            framebuffer.Attach(colorBuffer);
            framebuffer.Attach(depthBuffer);

            framebuffer.CheckCompleteness();

            return framebuffer;
        }