Beispiel #1
0
 public OldScene(Game1 game)
     : base(game)
 {
     this.game = game;
     quadRender = new QuadRenderComponent(game);
     game.Components.Add(quadRender);
 }
Beispiel #2
0
        /// <summary>
        /// Creates a new shadowmap resolver
        /// </summary>
        /// <param name="graphicsDevice">The Graphics Device used by the XNA game</param>
        /// <param name="quadRender"></param>
        /// <param name="baseSize">The size of the light regions </param>
        public ShadowMapResolver(GraphicsDevice graphicsDevice, QuadRenderComponent quadRender, ShadowMapSize maxShadowmapSize, ShadowMapSize maxDepthBufferSize)
        {
            this.graphicsDevice = graphicsDevice;
            this.quadRender = quadRender;

            reductionChainCount = (int)maxShadowmapSize;
            baseSize = 2 << reductionChainCount;
            depthBufferSize = 2 << (int)maxDepthBufferSize;
        }
Beispiel #3
0
        public Game1()
        {
            graphics = new GraphicsDeviceManager(this);
            Content.RootDirectory = "Content";
            this.IsFixedTimeStep = false;
            //graphics.SynchronizeWithVerticalRetrace = false;

            quadRender = new QuadRenderComponent(this);
            this.Components.Add(quadRender);

            TargetElapsedTime = TimeSpan.FromSeconds(1 / 30.0);
        }
Beispiel #4
0
        public void LoadContent()
        {
            mBackBufferHeight = mGame.GraphicsDevice.PresentationParameters.BackBufferHeight;
            mBackBufferWidth = mGame.GraphicsDevice.PresentationParameters.BackBufferWidth;

            mHalfPixel = new Vector2(0.5f / (float)mBackBufferWidth, 0.5f / (float) mBackBufferHeight);

            mCombineFinalEffect = mGame.Content.Load<Effect>(@"Shaders\Effects\CombineFinal\CombineFinal");

            mQuadRenderer = new QuadRenderComponent(mGame);
            mGame.Components.Add(mQuadRenderer);
        }
Beispiel #5
0
        public void LoadContent()
        {
            mBackBufferHeight = mGame.GraphicsDevice.PresentationParameters.BackBufferHeight;
            mBackBufferWidth = mGame.GraphicsDevice.PresentationParameters.BackBufferWidth;

            mHalfPixel = new Vector2(0.5f / (float)mBackBufferWidth, 0.5f / (float)mBackBufferHeight);

            mDirectionalLightEffect = mGame.Content.Load<Effect>(@"Shaders\Effects\Lightning\DirectionalLight");
            mPointLightEffect = mGame.Content.Load<Effect>(@"Shaders\Effects\Lightning\PointLight");

            mSphereModel = mGame.Content.Load<Model>(@"Models\sphere");

            mQuadRenderer = new QuadRenderComponent(mGame);
            mGame.Components.Add(mQuadRenderer);
        }
Beispiel #6
0
        public void LoadContent()
        {
            mBackBufferHeight = mGame.GraphicsDevice.PresentationParameters.BackBufferHeight;
            mBackBufferWidth = mGame.GraphicsDevice.PresentationParameters.BackBufferWidth;

            mHalfPixel.X = 0.5f / (float)mGame.GraphicsDevice.PresentationParameters.BackBufferWidth;
            mHalfPixel.Y = 0.5f / (float)mGame.GraphicsDevice.PresentationParameters.BackBufferHeight;

            mClearBufferEffect = mGame.Content.Load<Effect>(@"Shaders\Effects\GBuffer\ClearGBuffer");
            mRenderBufferEffect = mGame.Content.Load<Effect>(@"Shaders\Effects\GBuffer\RenderGBuffer");

            mQuadRenderer = new QuadRenderComponent(mGame);
            mGame.Components.Add(mQuadRenderer);

            mGround = mGame.Content.Load<Model>(@"Models\sprite200");

            //mGroundDiffuse = mGame.Content.Load<Texture2D>(@"Models\ground_diffuse");
            //mGroundNormal = mGame.Content.Load<Texture2D>(@"Models\ground_normal");
            //mGroundSpecular = mGame.Content.Load<Texture2D>(@"Models\ground_specular");
        }