Kinect sample code from Code Camp

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

Improve Your Life
Improve Your Team
Improve Your Code
Software Projects

David Walker

David Walker is a Secure Software Consultant, a Certified Secure Software Lifecycle Professional (CSSLP), and a Professional Scrum Master. He believes in secure and reliable software and productive happy teams. He lives in Orlando with his lovely wife Lynn and his 2 dogs.