I know that I can get that position on a regular material shader but obviously, postprocess shaders operate on a 2D space so I cannot get the Z (or world position).
Probably there is any chance to get it since it should be used in DOF and so but I didn’t find any way/sample I mean getting the Z Depth about postprocess there are lots of them here Babylon.js Playground
Thank you it worked unfortunately my intention was to calculate the velocities and I’m not sure why but I cannot reconstruct the actual word space coordinates from depth (I’ve found other topics with this question but none with a proper solution) .
https://playground.babylonjs.com/#Z8UKFT#2 here is my try where I tried to print the actual coordinates in the centre of the screen and the previous coordinates in the border but without luck.
I’m not quite sure what you want to compute in the shader…
Here’s what I could come up: it computes the velocities based on the current and previous position in the view space (so it’s a velocity based on the camera movements):
Note that you must do matrix*p to transform p by matrix, not p*matrix and the depth renderer must be setup in the “non linear” mode because the depth you use in NDC coordinates must be the non linear depth.