/// <summary> /// Create a DirectionalShadow. /// </summary> public DirectionalShadow(XiGame game, OrthoCamera shadowCamera) { XiHelper.ArgumentNullCheck(game, shadowCamera); this.game = game; this.shadowCamera = shadowCamera; shadowMapTarget = new ManagedRenderTarget2D(game, Constants.DirectionalShadowMapSurfaceToScreenRatio, 1, SurfaceFormat.Single, MultiSampleType.None, 0, 0); screenQuad = ScreenQuadGeometry.Create<VerticesPositionNormalTexture>(game.GraphicsDevice); }
/// <summary> /// Create a NullDirectionalShadow. /// </summary> /// <param name="game">The game.</param> public NullDirectionalShadow(XiGame game) { camera = new OrthoCamera(game.GraphicsDevice); }
private IDirectionalShadow CreateDirectionalShadow() { OrthoCamera shadowCamera = new OrthoCamera(Game.GraphicsDevice) { Width = Constants.DirectionalShadowSize.X, Height = Constants.DirectionalShadowSize.Y, NearPlane = 0, FarPlane = Constants.DirectionalShadowRange }; return new DirectionalShadow(Game, shadowCamera); }