Aligning RGB and Depth Kinect2


Hi vvvvorum!
Anyone knows how to align the depth map and the colour map from kinect2? In old kinect and OpenNI drivers it was buid into Depth node. I want to use Kinect2 as simple “greenscreen” generator…


not really working for fast moving objects
witch res u want depth or rgb
and u wanna do it urself or just a working code?


antokhio, I don’t think I’m capable of coding it myself(no experience at all), so working code. With kinect2 drivers comes wpf demo of kinect “greenscreen”, and is fast enough for me for overlaying hd rgb on background using depth mask.

Kinect movebackground skeleton RGB

… no text …

DepthToRgb.7z (1.8 kB)


Antokhio! thank you. I will try it tomorrow!


Antokhio! Working like a charm!. You 're right - rgb stream seems to be slower,more blurry, so I added echo to the mask. Not elegant way, but looks better…


Thumbs up to vux ;] Nice to hear all good, if u need more help gonna be around here…


Hi Antokhio! Is there an easy way to change playertexture to depthtexture, ie: to align depth to rgb, not player?
Texture2D ColorTexture : register(t0) : PREVIOUS;
Texture2D PlayerTexture : register(t1); <-------------depthtexture?
Texture2D DepthRGBMapTexture : register(t2);


hi, u gonna need more then that:
so line 25

return float4 (,body)

“body” is player atm so u have on output vector for rgb color and u add player as alpha to it. So if u change player texture on depth map it’s not gonna help much since u gonna write it to alpha

do a copy of ur shader and change

float body = PlayerTexture.Sample(linearSampler,map).r;
return float4 (,body);


float4 body = PlayerTexture.Sample(linearSampler,map);
return body;

that’s gonna give u back whatever texture u put in there aligned to color

RGBDepth (Kinect2)

God bless you, Antokhio (and vux of course)! I just changed one additional parameter, defining filter result as r16g16b16a16 (no banding). BTW, is there a node to change to-from a8r8g8b8 or any other combination, as it was in an old dx9 texture?

filter_all_to_rgb (724 Bytes)


To change the format you can use Renderer (DX11 TempTarget) … Check ChangeFormat (DX11.Texture 2d)


You can also specify in the pass section, copy the text from the renderer formats eg

pass P1 <string format=“R16G16B16A16_Float”;>


Great, thank you all!


Kinect2, win8.1 x64, try the above nodes, but didn’t get the effect of the below! You have any Suggestions



Evan, I will send you some help files tomorrow…


Evan, just unpack, and put “kinect_toolbox” folder into your x64 “packs” folder.
It’s little messy (in fact nodes are copies of kinect2 contribution- which is not necessary, plus some nodes added, hdface not working…). I’m using it without a problem with 33.7 x64. Your effect needs rgb and player combined. Have fun!

kinect toolbox (39.3 MB)


rogalag!This problem I’ve struggled with for a long time! Try to use node fusion player and RGB blend! But there are RGB camera and depth camera distance deviation! How can I thank you, really thank you very much!


you’re welcome!


… no text …