I am trying to calculate the ray direction for each pixel in a post processing shader on the Vision Pro for raymarching. I am using the inverse of the projection matrix created from the tangents provided by the Vision OS API to multiply the screen's coordinate converted to NDC. This works perfectly on the simulator and matches the raster scene rendered with that projection matrix, however on the device, the projected rays are completely off from the raster scene (they seem warped at the edges and don't match the projection).
This is also the case if I calculate the rays directly from the FOV & aspect without using the projection matrix inverse.
From what I understand the projection frustum tangents are skewed somewhat in the VR projection, but i thought the inverse of the projection matrix should still unproject the coordinate correctly.
Does anyone have any experience with raycasting/raymarching in VR and could shed some light?
Thank you.