Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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
add comment

2 Answers 2

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
add comment

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
add comment

Your Answer

 
discard

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.