Ejemplo n.º 1
0
        public override void QueueRenderCommands(SharpDX.Toolkit.GameTime gameTime, Renderer renderer, IGraphicsContext context)
        {
            if (resourcesDic == null)
            {
                resourcesDic = new Dictionary <string, GraphicsResource>();
                resourcesDic["gbDepthTexture"]   = context.GBuffer.DepthTarget;
                resourcesDic["gbNormalTexture"]  = context.GBuffer.NormalTarget;
                resourcesDic["gbAlbedoTexture"]  = context.GBuffer.AlbedoTarget;
                resourcesDic["texTransmittance"] = transmittanceT;
                resourcesDic["texIrradiance"]    = irradianceT;
                resourcesDic["texInscatter"]     = inscatterT;
            }

            var command = GenerateRenderCommand();

            renderer.EnqueuePostProcess(command);

            // post process
            //SetCameraParameters(context.CurrentCamera);
            //SetSunParameters();
            //SetTextures(context);

            //context.Device.SetBlendState(context.Device.BlendStates.AlphaBlend);

            //context.Device.SetVertexBuffer(atmosVb);
            //context.Device.SetVertexInputLayout(VertexInputLayout.FromBuffer(0, atmosVb));
            //atmosphere.Techniques["Atmosphere"].Passes[0].Apply();
            //context.Device.Draw(PrimitiveType.TriangleList, 6);
        }
Ejemplo n.º 2
0
        public override void Update(MenuScreen screen, bool isSelected, SharpDX.Toolkit.GameTime gameTime)
        {
            // Gradually fade between selected/deselected appearance
            float fadeSpeed = (float)gameTime.ElapsedGameTime.TotalSeconds * 4;

            if (isSelected)
            {
                _selectionFade = Math.Min(_selectionFade + fadeSpeed, 1);
            }
            else
            {
                _selectionFade = Math.Max(_selectionFade - fadeSpeed, 0);
            }
        }
Ejemplo n.º 3
0
        public override void Draw(MenuScreen screen, bool isSelected, SharpDX.Toolkit.GameTime gameTime)
        {
            Color color = isSelected ? Color.Yellow : Color.Black;

            // Pulsate thet size of the selected entry
            double time = gameTime.TotalGameTime.TotalSeconds;

            float pulsate = (float)Math.Sin(time * 6) + 1;

            float scale = 1 + pulsate * 0.05f * _selectionFade;

            // Modify the alpha to fade text out during transitions.
            color *= screen.TransitionAlpha;

            // Draw text, centered on the middle of each line
            SpriteBatch spriteBatch = screen.ScreenManager.SpriteBatch;
            SpriteFont  font        = screen.ScreenManager.MenuFont;

            Vector2 origin = new Vector2(0, font.LineSpacing / 2f);

            spriteBatch.DrawString(font, Text, Position, color, 0f,
                                   origin, scale, SpriteEffects.None, 0f);
        }
 public void Update(SharpDX.Toolkit.GameTime gameTime)
 {
 }