示例#1
0
        public void compute()
        {
            _fbo.bind();
            Buffer.draw(DrawBufferMode.ColorAttachment0);
            Buffer.setMask(0, true, false, false, false);
            Buffer.clear(0, 0, 0, 0);

            Depth.disableTest();
            Depth.setMask(false);
            Blend.equation(BlendEquationMode.FuncAdd);
            Blend.func(BlendingFactorSrc.One, BlendingFactorDest.One);
            Blend.enable();

            Example._scene.thickComputing.use();
            {
                Matrix4 tr = Example._scene.meshAnimation.pose.transformation_matrix;
                Example._scene.thickComputing.bindUniformMatrix4("transformation_matrix", false, ref tr);
                Example._scene.meshAnimation.pose.drawElements();
            }
            Shading.close();

            Blend.disable();
            Depth.enableTest();
            Depth.setMask(true);
            Buffer.setMask(0, true, true, true, true);

            FrameBuffer.unbind();
            Buffer.draw(DrawBufferMode.Back);
        }
示例#2
0
        public override void compute(Texture tex_color_front, Texture tex_color_back)
        {
            Depth.setMask(false);
            Depth.disableTest();
            Blend.enable();

            _fbo_blend.bind();
            Buffer.draw(DrawBufferMode.ColorAttachment0);
            Blend.equation(BlendEquationMode.FuncAdd);
            Blend.funcSeparate(BlendingFactorSrc.DstAlpha, BlendingFactorDest.One, BlendingFactorSrc.Zero, BlendingFactorDest.OneMinusSrcAlpha);
            {
                Texture.rendering.use();
                {
                    Texture.active(TextureUnit.Texture0); tex_color_front.bind();
                    Texture.image.draw();
                }
                Shading.close();
            }

            Buffer.draw(DrawBufferMode.ColorAttachment1);
            Blend.equation(BlendEquationMode.FuncAdd);
            Blend.func(BlendingFactorSrc.One, BlendingFactorDest.OneMinusSrcAlpha);
            {
                Texture.rendering.use();
                {
                    Texture.active(TextureUnit.Texture0); tex_color_back.bind();
                    Texture.image.draw();
                }
                Shading.close();
            }

            Blend.disable();
            Depth.enableTest();
            Depth.setMask(true);
        }
示例#3
0
 private void   drawBackgroundTexture()
 {
     if (_useBackgroundTexture && _backgroundTexture != null)
     {
         Depth.disableTest();
         Depth.setMask(false);
         Blend.equation(BlendEquationMode.FuncAdd);
         Blend.funcSeparate(BlendingFactorSrc.OneMinusDstAlpha, BlendingFactorDest.DstAlpha, BlendingFactorSrc.Zero, BlendingFactorDest.Zero);
         Blend.enable();
         {
             _backgroundTexture.drawB();
         }
         Blend.disable();
         Depth.enableTest();
         Depth.setMask(true);
     }
 }