Kinect Point Cloud.zip (341.0 KB)
As I’m working with a depth texture, I need to create the positions in a shader, I have a view cone visualised of my kinect, I expected to be able to use the same transform to warp the points to the view cone in the shader, but no matter how I’ve wrangled it, they keep to a rectanlge. I’m sure I’ve done this in v4, but can’t find the patch :D. What am I missunderstanding?
( I know I could use the same technique as the skia3d point cloud, but it seems less efficient to turn into bytes, and I’m trying to use really low power processors on the kinect end)
PointCloud.zip (340.7 KB)
Kind of works, but the depth is now non linear and the pointsprites no longer lookat the camera, as I have to worldviewprojection after the look at to get it work at all.
Any help gratefully recieved. I’m guessing it is stride doing weird overides. Why does World not work in the VS? What is it that I dont understand?
there were no hidden overrides or so, it was mainly a question of doing things in the right order. I’ve added some comments in the shader but probably messed up the Kinect transform a bit, you might have to re-adjust it: PointCloud2.zip (338.9 KB)
also, the sprite technique you were using could be improved. instead of creating the sprites in world space and then inverting the view to rotate them towards the camera, you can create the sprites in view space. like that, they will automatically face the camera. and in the PS you can save a sqrt op by comparing the squared length to a squared distance.
That looks great, but why was it when I tried using the World transform in the VS it simply didn’t work! Everything got moved to the GS becuase that was the only way I could get anything. Just about the only thing I didnt try was mul(kinect, World) which I guess must be the missing link! Thanks so much!
Ah I was doing some * transforms outside as well, they were probably the bugger!