protected override void LoadContent()
        {
            if (Engine.SpriteBatch == null)
                Engine.SpriteBatch = new SpriteBatch(GraphicsDevice);

            cloner = new RenderTarget2D(GraphicsDevice, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
            shadowMapResolver = new ShadowMapResolver(GraphicsDevice, World.LightsFX, GraphicsDevice.Viewport.Width);
            _lightSource = new LightSource(Engine.AnglerGame.GraphicsDeviceManager, GraphicsDevice.Viewport.Width, LightAreaQuality.VeryHigh, Color.White);
            shadowMap = new ShadowCasterMap(PrecisionSettings.VeryHigh, Engine.AnglerGame.GraphicsDeviceManager, Engine.SpriteBatch);

            base.LoadContent();
        }
        protected override void LoadContent()
        {
            if (Engine.SpriteBatch == null)
            {
                Engine.SpriteBatch = new SpriteBatch(GraphicsDevice);
            }

            cloner            = new RenderTarget2D(GraphicsDevice, GraphicsDevice.Viewport.Width, GraphicsDevice.Viewport.Height);
            shadowMapResolver = new ShadowMapResolver(GraphicsDevice, World.LightsFX, GraphicsDevice.Viewport.Width);
            _lightSource      = new LightSource(Engine.AnglerGame.GraphicsDeviceManager, GraphicsDevice.Viewport.Width, LightAreaQuality.VeryHigh, Color.White);
            shadowMap         = new ShadowCasterMap(PrecisionSettings.VeryHigh, Engine.AnglerGame.GraphicsDeviceManager, Engine.SpriteBatch);

            base.LoadContent();
        }
Exemple #3
0
 public Light(Vector2 PlayerPos)
 {
     MyPosition               = Vector2.Zero;
     Game                     = TVSGame.Instance;
     sb                       = new SpriteBatch(Game.GraphicsDevice);
     LightsFX                 = new LightsFX(Loader.LoadEffect("resolveShadowsEffect"), Loader.LoadEffect("reductionEffect"), Loader.LoadEffect("2xMultiBlend"));
     ShadowMapResolver        = new ShadowMapResolver(Game.GraphicsDevice, LightsFX, 128);
     LightSource              = new LightSource(Game.graphics, Config.PlayerLightRadius, LightAreaQuality.High, Config.PlayerLightColor);
     Bullets                  = new List <LightBullet>();
     ShadowMap                = new ShadowCasterMap(PrecisionSettings.VeryHigh, Game.graphics, sb);
     LightPosition            = new Vector2(Game.GraphicsDevice.Viewport.Width / 2, Game.GraphicsDevice.Viewport.Height / 2);  //PlayerPos;
     ScreenLights             = new RenderTarget2D(Game.GraphicsDevice, Game.GraphicsDevice.Viewport.Width, Game.GraphicsDevice.Viewport.Height);
     ScreenGround             = new RenderTarget2D(Game.GraphicsDevice, Game.GraphicsDevice.Viewport.Width, Game.GraphicsDevice.Viewport.Height);
     ShadowMapResolverBullets = new ShadowMapResolver(Game.GraphicsDevice, LightsFX, 128);
 }