Guest User

fs2

a guest
Jul 28th, 2015
53
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. protected override void Draw(GameTime gameTime)
  2. {
  3. bloom.BeginDraw(renderTarget);
  4. bloom.ShowBuffer = BloomComponent.IntermediateBuffer.FinalResult;
  5.  
  6.  
  7. bloom.Draw(gameTime, renderTarget);
  8.  
  9. DrawSceneToTexture(renderTarget);
  10.  
  11. spriteBatch.Begin(SpriteSortMode.Immediate, BlendState.AlphaBlend,
  12. SamplerState.LinearClamp, DepthStencilState.Default,
  13. RasterizerState.CullNone);
  14.  
  15.  
  16. spriteBatch.Draw(renderTarget, rec, Color.White);
  17.  
  18. spriteBatch.End();
  19.  
  20. base.Draw(gameTime);
  21.  
  22. }
  23. protected void DrawSceneToTexture(RenderTarget2D renderTarget)
  24. {
  25.  
  26. GraphicsDevice.SetRenderTarget(renderTarget);
  27.  
  28. GraphicsDevice.DepthStencilState = new DepthStencilState() { DepthBufferEnable = true };
  29.  
  30. // Draw the scene
  31. GraphicsDevice.Clear(Color.CornflowerBlue);
  32. spriteBatch.Begin(SpriteSortMode.Deferred,
  33. BlendState.AlphaBlend,
  34. SamplerState.PointClamp,
  35. null, null, null, null);
  36. mLeavusSprite.Draw(this.spriteBatch);
  37. b.Draw(this.spriteBatch);
  38. spriteBatch.Draw(cursorTex, cursorPos, cursorSource,
  39. Color.White, 0.0f, Vector2.Zero, 3f, SpriteEffects.None, 0);
  40. spriteBatch.End();
  41. // Drop the render target
  42. GraphicsDevice.SetRenderTarget(null);
  43. }
  44. }
RAW Paste Data