Persistent Distortion Shaders

 

 

click for larger versions.

 

Synopsis:

A final project for a graduate-level class I took at RPI - Advanced Computer Graphics. I had wanted to explore shaders for a while, and when my concurrent game dev team resolved to use an engine that didn't support them, I decided to use this assignment as a learning experience. By the end of the project, I had learned both GLSL and HLSL, the respective OpenGL and DirectX shader languages. Ultimately, I went with an HLSL/DirectX project, because of its inclusion in the XNA framework (which I also wanted to learn to use...).

 

The project was oriented around persistent distortion effects, that factored a new contribution each frame into a larger overall effect. The results included a color blending lens flare-like effect, and two rippling water-like effects that create trails of distortion across the screen.

 

Tech:

The main concept explored was persistent distortion, or maintaining information about the effect applied on previous frames. It was implemented by using a distortion texture (seen in screenshot 4) that defined pixel-based sampling offsets. In other words, if a pixel was reddish, it indicated that the corresponding pixel in the image should sample a pixel slightly further in the X axis than its actual location.

 

This project was also my first XNA program, as well as my first C# program, so a lot of the functionality was a bit hacked together...

 

Video: (video compression reduced quality...)

 

Requirements:

XNA Framework 3.0 or 3.1 (Windows only)

Either Visual C# 2008 Express (free) or Visual Studio 2008 (not...)

Note: Installing VC#2008 Express will not break a Visual Studio 2005 install.

 

Download Now