Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can I make a black shadow/glow around my drawn rectangle made of primitives? Drop-shadowing is easy, but it's not exactly what I am looking for.

share|improve this question
up vote 6 down vote accepted

Render your primitives to a render target, and then use a pixel shader to blur and blacken the render target when you draw it back onto the screen. Then simply draw your render target without a pixel shader (or render your original primitives) to the backbuffer.

The Bloom Postprocess sample on App Hub should provide a sufficient example of how to render to a render target and then post-process it with a blur, to implement your effect.

share|improve this answer

Make two textures - foreground and background.
First draw your shapes in black color on first texture, and then blur this texture.
Next draw your shapes in normal color on second texture.
Draw first, then second.
Keywords: postprocessing, RenderTarget2D, gaussian blur

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.