How would one go about writing a pixel shader like this one in XNA 4.0?
-
\$\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 DickinsonCommented Nov 23, 2011 at 12:37
2 Answers
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.)
How would one go about writing a pixel shader like this one in XNA 4.0?
- learn how pixel shaders work by researching websites, articles, books.
- follow various tutorials and gain familiarity and comfort level with HLSL.
- experiment. experiment. Ask specific questions about it. Play around till you get it.