- Home /
Post Processing Stack Ambient Occlusion stops working on runtime with Unity, VRTK, and SteamVR on the HTC Vive
When adding ambient occlusion from the Post Processing Stack asset onto the SteamVR camera, it works fine until I hit the play button (SteamVR is enabled for this as the VRTK manager automatically disables it). After that it disappears. I noticed that if I move the post processing behavior script in the component hierarchy during runtime, the ambient occlusion works. Any assistance is appreciated.
It works here when I try it (and doesn't remove the controller objects) -- try attaching the post processing component to the head object, sorry I'm not sure what it's called in the original S$$anonymous$$mVR as we renamed a bunch of tree nodes in our project -- however, it's not fully compatible to stereo view unfortunately and will create noticable left-right eye inconsistencies (which are perceived as something flickery being off especially in brighter spots, if I had to describe it). A compatibility chart is here: https://support.middlevr.com/hc/en-us/articles/203900075-VR-compliant-post-processing-effects-in-Unity
Also, this asset claims to be vr-compatible (avoiding the current incompatibility of Unity's default one): https://www.assetstore.unity3d.com/en/#!/content/67927
Answer by Tishbyte · Oct 26, 2017 at 07:00 PM
I found that adding the Post Processing Behavior script to the CameraRig gameobject fixes the issue. Not sure why though.
Edit: This also makes the controllers not visible. Not a valid solution.
Edit I found that adding a camera with the Post Processing Stack script as a child of cameraRig gameobject fixes the issue. It seems that something in the eye gameobject is causing the incompatibility.
Adding another camera ruins the H$$anonymous$$D tracking tho. Have you found a proper way to make postprocessing stack work with s$$anonymous$$mVR? Sadly i think i'll have to go for OVR or Unity's built in VR support because not being able to use postprocessing is awful. And not having controllers simply makes no sense.
So the way I have it set up is under the CameraRig gameobject there are the Camera (head), the Controller (left), and the Controller (right). Right along with them I place a new camera with the Post Processing Behavior script attached. What I have done is disable the camera with the script and that seems to work in a strange way. I haven't been able to test it in a while and the project is now outdated, but let me know if that works for you.
i somehow managed to make it work by deleting my camerarig and dropping a new one on hierachy, then adding an extra camera with the postprocessing effects normally. It's quite unstable but hey, it worked, i have controllers and effects.