Open andybak opened 7 years ago
The alternative being a quad in any position where the vertex shader repositions it at the camera?
I think the alternative being the solution used here, which is elegant as hell - blit within OnRenderImage, passing the camera matrix, works perfectly with the scene camera. Thank you for making and tutorial-izing this @Flafla2 <3
Any idea what's missing to make this work in VR? It breaks Single Pass, which may be a complicated fix, but Multi Pass should be easy in theory. In Multi Pass the matrix is slightly off, but symmetrically for each eye, the camera does pass a separate matrix for each.
I wasn't able to find a correct matrix in the APIs. I tested it on a Vive, with Camera.stereoActiveEye
, and Camera.GetStereoViewMatrix(StereoscopicEye eye)
. I wonder if the SteamVR_Camera is doing something different on render. But I'm a bit out of my depth with these SteamVR / open XR APIs. For instance I was able to get a projection matrix from SteamVR (with HMDMatrix4x4ToMatrix4x4(SteamVR.instance.hmd.GetProjectionMatrix(evrEye ...))
, but not a view matrix. Any ideas?
I'll try and take a look myself but I'm trying to find a raymarcher that blits directly to the camera that does work in VR to use as an example. Most tend to use a quad parented to the camera.