Example #1
0
        protected override void Draw(GameTime gameTime)
        {
            GraphicsDevice.Clear(Color.CornflowerBlue);

            if (mode > 0)
            {
                GraphicsDevice.SetRenderTarget(rt);
            }

            spriteBatch.Begin();
            spriteBatch.Draw(texture, new Rectangle(0, 0, 1280, 720), Color.White);
            spriteBatch.End();

            if (mode > 0)
            {
                SMAA.Input sinput;
                switch (mode)
                {
                case 1:
                    sinput = SMAA.Input.DEPTH;
                    break;

                case 2:
                    sinput = SMAA.Input.LUMA;
                    break;

                case 3:
                    sinput = SMAA.Input.COLOR;
                    break;

                default:
                    Debug.Assert(false);
                    return;
                }

                smaa.Go(rt, rt, null, sinput);
            }

            base.Draw(gameTime);
        }