So I believe that Unreal has recently changed the way PostProcessing materials are applied in VR. Via Google, I saw a lot of people claiming that the ScreenPosition UV is essentially split in half per eye (i.e., 0.5 on the X is the right edge of the left eye/left edge of the right eye), but what I was seeing with my Index is that whatever effect I was applying was appearing exactly the same for both eyes. The result was that when I tried to apply the “vignette” effect with the RadialGradientExponential node in the material editor, instead of just closing in around my peripheral vision, it was putting this huge shadow between my eyes. Not really ideal, obviously.
I searched around for ages trying to figure out how to isolate each eye in the material and finally came across the answer: You can create a custom node which outputs CMOT Float 1
type, and in the “code” block, enter: return ResolvedView.StereoPassIndex;
The output of the node will be 0
for the left eye, and 1
for the right eye. From there, it was a simple matter of hooking up some extra nodes to offset the horizontal center position of the gradient for each eye:
What you see in the preview pane there is for the left eye, and the right eye displays its mirror opposite. I don’t have any other headsets to test on, but what I found for the Index was that 20% from “center” was right about the correct spot for the vignette to appear right around the edges of my peripheral vision without adding any weirdness between my eyes.
Hope this comes in handy for someone else! If you have an Oculus, Vive, or WMR headset and decide to give this a try, please let me know how it goes! I’d be curious to know if it works any differently with other HMDs.