Sunday, April 10, 2011

HLSL (DirectX/XNA) effect for stereo side by side anaglyph

The following code takes the input texture and paints over it the stereo effect.
The technique used (actually the colro transformation matrix) is called Dubois by it's original author.

You will need to set the texture and the width/height from your DX / XNA code:



You will have to render to texture and then show only the half of the image that you need (if the first image in the source is left show the left side, else the right). If the source is half SBS (means shrinked to half) then you need to stretch it back (double the width).

No comments:

Post a Comment