0
\$\begingroup\$

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

http://www.youtube.com/watch?v=f1uZvurrhig&feature=related

\$\endgroup\$
  • \$\begingroup\$ 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. \$\endgroup\$ – Jonathan Dickinson Nov 23 '11 at 12:37
1
\$\begingroup\$

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.)

| improve this answer | |
\$\endgroup\$
-2
\$\begingroup\$

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.
| improve this answer | |
\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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