public void Draw(GraphicsDevice device) { PostProcessor postprocessor = PostProcessor.GetInstance(device); device.SetRenderTargets(postprocessor.color_rt, postprocessor.depth_rt); device.Clear(ClearOptions.Target | ClearOptions.DepthBuffer | ClearOptions.Stencil, Application.CLEAR_COLOR, 1.0f, 0); device.BlendState = BlendState.Opaque; device.DepthStencilState = DepthStencilState.Default; level.Draw3dEntities(device, camera); postprocessor.DepthOfField(postprocessor.color_rt, postprocessor.result_rt, postprocessor.depth_rt, camera, DepthOfFieldType.DiscBlur, player.position.Z, 5, total_time); device.SetRenderTarget(postprocessor.color_rt); device.Clear(ClearOptions.Target, Application.CLEAR_COLOR, 1, 0); device.BlendState = BlendState.AlphaBlend; level.Draw2dEntities(device, camera); device.DepthStencilState = DepthStencilState.DepthRead; particlemanager.Draw(device, camera); device.DepthStencilState = DepthStencilState.Default; level.DrawBubbleReflections(device, camera); device.SetRenderTargets(postprocessor.result_rt); SpriteRenderer spriterenderer = SpriteRenderer.GetInstance(device); spriterenderer.Begin(null); spriterenderer.Add(new TextureRegion(postprocessor.color_rt, 0, 0, postprocessor.color_rt.Width, postprocessor.color_rt.Height), Color.White, 0, 0, postprocessor.color_rt.Width, postprocessor.color_rt.Height, 0); spriterenderer.End(); }
public override void Draw(GraphicsDevice device) { PostProcessor postprocessor = PostProcessor.GetInstance(device); postprocessor.Blur(postprocessor.result_rt, postprocessor.result_rt, 0.5f + 8 * background); float x, y; x = (device.PresentationParameters.BackBufferWidth - logo.width) / 2f; y = (device.PresentationParameters.BackBufferHeight - logo.height) / 2f; SpriteRenderer spriterenderer = SpriteRenderer.GetInstance(device); spriterenderer.Begin(null); spriterenderer.Add(logo, new Color(1f, 1f, 1f, alpha), x, y, logo.width, logo.height, 0); spriterenderer.End(); }
protected override void Draw(GameTime gameTime) { SpriteRenderer.Clear(); PostProcessor postprocessor = PostProcessor.GetInstance(device); device.SetRenderTargets(postprocessor.result_rt); device.Clear(CLEAR_COLOR); device.SamplerStates[0] = SamplerState.LinearWrap; //device.SamplerStates[0] = SamplerState.PointClamp; device.DepthStencilState = DepthStencilState.Default; device.BlendState = BlendState.AlphaBlend; screenmanager.Draw(device); postprocessor.Bloom(postprocessor.result_rt, null, 0.25f, 1, 2 * brightness, 0.5f, 0.5f); }
public override void Draw(GraphicsDevice device) { PostProcessor postprocessor = PostProcessor.GetInstance(device); postprocessor.Blur(postprocessor.result_rt, postprocessor.result_rt, 0.5f + 8 * fade_value); SpriteRenderer spriterenderer = SpriteRenderer.GetInstance(device); spriterenderer.Begin(null); spriterenderer.AddString(font_title, title.ToUpper(), GetX(), GetY(), 0, title_scale, title_kerring, 0, 0, 0, new Color(1f, 1f, 1f, fade_value)); for (int i = 0; i < options.Length; i++) { spriterenderer.AddString(font_option, options[i].name.ToUpper(), GetOptionPositionX(i), GetOptionPositionY(i), 0, option_scale /*+ (options[i].value - default_intensity) * option_scale * 0.1f*/, option_kerring, 0, 0, 0, new Color(options[i].value, options[i].value, options[i].value, fade_value)); } spriterenderer.AddString(font_description, options[curr_option].desc.ToUpper(), GetX(), GetY() + (font_title.height * title_scale * 3) + options.Length * (font_option.height + font_option.height * 0.5f) * option_scale, 0, desc_scale, desc_kerring, 0, 0, 0, new Color(1f, 1f, 1f, fade_value / 2)); //spriterenderer.AddString(Resources.arial10px_font, string.Format("transition:{0:0.000} switch:{1:0.000} scroll:{2:0.000}", fade_value, time_1, time_2), x, y-12); spriterenderer.End(); }