Explanation
First I take the pixels from the raw input and sort them by luminosity. I put the brightest in each column at the bottom, and the darkest at the top. I then displace the pixels vertically based on a counter running through a sine function. The function itself, and the speed of the counter, is dependent on the average brightness of each frame. When the frame is darker the wave oscillates quicker (it's afraid of the dark).
In the original version I used a Microsoft Kinect to get depth data, and would change the frequency based on the viewer's proximity, but unfortunately my Macbook can't do that.
If you want to see the code lmk! I'm not stingy about this kind of thing.