Ejemplo n.º 1
0
        public cEngine(GraphicsDeviceManager gd, ContentManager cm)
        {
            _instance = this;
            _graphics = gd;
            _contentManager = cm;

            _postProcessor = new cPostProcessor(gd.GraphicsDevice, cm);
            _gameState = GAME_STATE.NOTHING;
            _batch = new cCustomSpriteBatch(gd.GraphicsDevice);

            _HUD = new cHUD();
        }
Ejemplo n.º 2
0
        public cPostProcessor(GraphicsDevice gd, ContentManager cm)
        {
            _instance = this;

            _initBrightPassValue = 0.8f;
            _finalBrightPassValue = 0f;
            _brightDarkCount = 0;
            _brightDarkMaxTimer=-1;
            _brightPassValue = _initBrightPassValue;

            _brightPassShader = cm.Load<Effect>(@"Resources/Shaders/Bloom/brightPass");
            _downsamplePassShader = cm.Load<Effect>(@"Resources/Shaders/Bloom/downsamplePass");
            _hozbloomPassShader = cm.Load<Effect>(@"Resources/Shaders/Bloom/hozbloom");
            _vertbloomPassShader = cm.Load<Effect>(@"Resources/Shaders/Bloom/vertbloom");
            _finalPassShader = cm.Load<Effect>(@"Resources/Shaders/Bloom/finalPass");

            //_batch = new cSpriteBatch(gd);
            _ppBatch = new cPostProcessBatch(gd);

            _sceneRender = new RenderTarget2D(gd,
                gd.Viewport.Width,
                gd.Viewport.Height,
                1,
                gd.DisplayMode.Format);

            _brightPassRender = new RenderTarget2D(gd,
                gd.Viewport.Width / 2,
                gd.Viewport.Height / 2,
                1,
                gd.DisplayMode.Format);

            _downsamplePassRender = new RenderTarget2D(gd,
                gd.Viewport.Width / 6,
                gd.Viewport.Height / 6,
                1,
                gd.DisplayMode.Format);

            _hozbloomPassRender = new RenderTarget2D(gd,
                gd.Viewport.Width / 6,
                gd.Viewport.Height / 6,
                1,
                gd.DisplayMode.Format);

            _vertbloomPassRender = new RenderTarget2D(gd,
                gd.Viewport.Width / 6,
                gd.Viewport.Height / 6,
                1,
                gd.DisplayMode.Format);
        }