strangerattractor / Soundvision_PUBLIC

Max's long long journey into the unity world.
Other
12 stars 1 forks source link

Kinect Depth Image not in Red Channel of Kinect Texture #111

Closed strangerattractor closed 4 years ago

strangerattractor commented 4 years ago

I have been trying to optimize the ShaderGraph Demo towards proper proportions today.

While working with it I think I found a mistake.

The Texture coming from the Kinect looks like it is actually the red channel, and not the depth channel coming out of the texture.

Kinect Red Channel Mistake 2 Kinect Red Channel Mistake 1 Kinect Red Channel Mistake 3

Am I using the texture wrong or are you giving out the actual red channel and not the depth channel from the kinect?

Or it is kind of a combination of different channels? depth and something?

while searching for examples i found that the depth output texture of the kinect should look more like this image

chikashimiyama commented 4 years ago

It's not a bug. It's intended. There is no such thing like "depth channel" in texture. You can use only RGBA. I use red-channel-only 16 bit texture fo storing data because GBA channels are redundant.

And please do not mix this texture context with "color buffer" and "depth buffer" difference in 3D rendering.

chikashimiyama commented 4 years ago

If you want to have black to white visualization using depth information. You can connect red channel to RGB channels so that you can convert "black to red" scale to "black to white" scale which is exactly like the "normal" depth map visualization.

strangerattractor commented 4 years ago

If you want to have black to white visualization using depth information. ...

@chikashimiyama I did that. But why is my picture then showing brighter objects as brighter and not closer objects as brighter?

Do I have to convert it before using it for position?

strangerattractor commented 4 years ago

I put the red channel from your texture out to rgb. The outcome is the above.

strangerattractor commented 4 years ago

It looks like the infrared image, not the depth image.

strangerattractor commented 4 years ago

so what I actually need to work with is the depth image, not the infrared image.

strangerattractor commented 4 years ago

image

a) RGB b) depth c) infrared

what I need is b) to work with, but right now I get c) correct?

chikashimiyama commented 4 years ago

replace infrared with depth frame. plz test.

strangerattractor commented 4 years ago

it works, perfectly. But now I have to check how to properly scale the depth effect, for example in shadergraph.