Exemplo n.º 1
0
        protected override void LoadContent()
        {
            base.LoadContent();

            _projectionMatrix = Matrix.CreatePerspectiveFieldOfView(
                (float)Math.PI * 0.25f,
                (float)TargetSize.Width / TargetSize.Height,
                0.05f,
                1000f);

            var camera = new Camera(_projectionMatrix)
            {
                ViewPosition = new Vector3(-.0f, .0f, 1.2f)
            };
            var device = Graphics.GraphicsDevice;

            _sun = new Sun(StarType);
            _sun.Create(Graphics, Content, camera);

            _usePostProcessor = device.GraphicsDeviceCapabilities.DeviceType == DeviceType.Hardware &&
                                device.GraphicsDeviceCapabilities.MaxPixelShaderProfile >= ShaderProfile.PS_3_0;

            if (_usePostProcessor)
            {
                _postProcessor = new PostProcessor(device, Content);
            }
        }
Exemplo n.º 2
0
        private void LoadSun()
        {
            var camera = new Camera(_projectionMatrix)
            {
                ViewPosition = new Vector3(-.0f, .0f, 1.2f)
            };

            _sun = new Sun();
            _sun.Create(this, _contentManager, camera);
        }