How to combine two texture 2D together ?(Kinect)

Hi, i am working on kinect project in unity3d. i want to display the player on top of the static background. Right now i can display the RGB image on the plane. Also i can extract
user body from the color plane. So How can i combine the user body and static background(picture)?

You could have a crack at doing it using a couple of Texture2D instances, but the issue there is you’d be doing pixel-by-pixel operations on the CPU, which is frankly hella slow for even a 640x480 texture.

You’d be better off applying 2 materials to the same mesh. One material will be the background, one will be the foreground with the highlighted player. Then you can just change the kind of shader each material uses until you get what you want. Also you might want to change the order the materials are assigned to the mesh (background in slot 0, foreground in slot 1, or vice-versa since that’ll change the order one is drawn on top of the other).

My guess is you’ll want the background to be Diffuse or Unlit/Diffuse, and the foreground to be Particles/Additive.