Beispiel #1
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);
     }
 }
Beispiel #2
0
        public override void draw(bool useTexture)
        {
            _fbo_color.bind();
            Depth.clear();
            Buffer.draw(DrawBufferMode.ColorAttachment0);
            Buffer.clear(0, 0, 0, 0);

            _rendering.use();
            {
                Texture.active(TextureUnit.Texture0); _tex_blend.bind();
                Texture.active(TextureUnit.Texture1); _tex_back.bind();
                Texture.image.draw();
            }
            Shading.close();

            FrameBuffer.unbind();
            Buffer.draw(DrawBufferMode.Back);

            Depth.clear();
            Buffer.clear(0, 0, 0, 0);
            _tex_color.draw();
        }
Beispiel #3
0
        public override void compute(Texture tex_color)
        {
            _fbo_blend.bind();
            Buffer.draw(DrawBufferMode.ColorAttachment0);

            Depth.disableTest();
            Depth.setMask(false);
            Blend.enable();

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

            Depth.enableTest();
            Depth.setMask(true);
        }