Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

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 would one go about writing a pixel shader like this one in XNA 4.0?

share|improve this question
This wouldn't be implemented via a pure pixel-shader. The most likely method is to render the scene to a texture, increase the contrast of that image and slowly fade it out over a few seconds. – Jonathan Dickinson Nov 23 '11 at 12:37
up vote 1 down vote accepted

Go to the shaders section of Microsoft's App Hub XNA samples and start poking around.

The bloom sample demonstrates a similar effect.

To achieve the effect from the video you would want to render the highlights to a buffer, which you then would clear gradually (using a semi-transparent quad), rather than clearing it completely each frame.

(Or you might bounce it between buffers, with a shader that does the appropriate fall-off.)

share|improve this answer

How would one go about writing a pixel shader like this one in XNA 4.0?

  1. learn how pixel shaders work by researching websites, articles, books.
  2. follow various tutorials and gain familiarity and comfort level with HLSL.
  3. experiment. experiment. Ask specific questions about it. Play around till you get it.
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.