David Walker

Kinect sample code from Code Camp

by David Walker

I have posted my code from Nebraska Code Camp. The most significant change is that I am using shaders to merge the multiple layers I am creating.

The original way to merge the layers was using C# code and reviewing each pixel to determine whether it appeared behind or in front of the pixel from another layer. With shaders, I can do the same comparison lightning fast in the video card.

HLSL shaders, effects, or pixel shaders are all referring to basically the same thing. I have an "Effect" in WPF that refers to the shader that I created that will be compiled by the ShaderBuildTask. (that part is automagically part of the build process once you install ShaderBuildTask)

The shader (DepthMerge.fx) gets textures for the color and depth of each frame it is combining. It compares the depths to find the closest pixel and returns the color for that pixel.

Download the Code Camp version of VideoMagic from http://graxark.codeplex.com/releases/view/84267

David Walker

David Walker is a Software Consultant, Photographer, and Digital Artist based out of Orlando, Florida, USA.

He believes in secure reliable software and productive happy teams.

More ...