Crash Test Bunny

Please understand that Oregon State University’s Academic Integrity Policy strictly prohibits me from releasing my code publicly. The above video is intended to demonstrate the basic principles of the project, and additional information about my work can be provided on request.

For this project I rendered a bunny object to a texture and created a sophisticated motion blur effect. My original project proposal planned to continuously save the framebuffer, then use the results from that process to approximate blurring. However, I found that proposal did not employ the use of shaders in a way that would have satisfied the project requirements. The results of that process unfortunately did not yield a good quality effect either. The motion blur I did implement was inspired by Nvidia’s GPU Gems 3, which contains some excellent documentation for image effects. While Nvidia does provide some documentation for HLSL there were several unique considerations I had to make for this project. Notably, I don’t know HLSL! I also had to compensate for other challenges such as the fact that there’s no such thing as a “previous position” in a static image.

The blur effect is achieved in the fragment shader, and I pass it a number of uniform variables which include the depth buffer and color buffer. First, I sample from the depth buffer to find each pixels current position and world position. Next, I take the world position and multiply it by the blur position (which acts as a stand-in for the direction of movement) to find the “previous position.” This allows me to calculate a velocity, which can be scaled by a uniform variable. In the third and final stage I sample the color buffer in a loop, using the velocity to get the blur color. The number of times the color buffer is sampled can be altered with a uniform variable depending on the quality desired. The more samples you use the smoother the effect becomes.

No blur:

2D bunny with orange and red stripes

Blur with low color buffer sampling:

2D bunny with orange and red stripes and a low quality blur

Blur with high color buffer sampling: 2D bunny with orange and red stripes and a high quality blur