Whenever building any application for GearVR (Presumably any Android VR application) it is impossible to use any post processing. I have tried it with Unity's legacy image effects, other plugins like AmplifyColor, and the new PostProcessing stack. All of these things claim to have been updated to support single-pass stereo rendering.
If I build with multi-pass, everything compiles fine and works fine on the app. If I build with single-pass, the screen is white or mostly white, depending on the effect. With a noise effect I can see extremely large pixels bouncing around, so something is running. Of note is the fact that many of the unity default and included shaders throw an error when single-pass is enabled and compiled.
Shader error in 'Hidden/Post FX/Uber Shader': undeclared identifier 'sampler_CameraDepthTexture' at line 191 (on gles3)
Compiling Vertex program with STEREO_MULTIVIEW_ON DEPTH_OF_FIELD_COC_VIEW
Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER2 UNITY_COLORSPACE_GAMMA
This error shows up in every shader, included or custom, that runs SAMPLE_DEPTH_TEXTURE(_CameraDepthTexture, i.uv); This includes the built-in shaders, which I cannot modify. I have checked every shader that I can, and the variables are indeed declared; not to mention that they work fine when compiled in multi-pass. It seems like single-pass stereo rendering is revoking access to the depth texture, which causes any post processing to render directly on top of the camera, causing the white or broken view.
----------
**Reproduction steps (GearVR):**
- Make any unity project
- Import any post-processing effects. (Eg. [The legacy image effects][1] or [the new PostProcessing stack][2])
- Add any effect(s) to the camera.
- Build with multi-pass rendering, observe that it works fine.
- Build with single-pass stereo rendering, test the app on GearVR and see the problems. Also note the new errors in the shaders which appear in the unity console output. Those do not happen in multi-pass.
[1]: https://www.assetstore.unity3d.com/en/#!/content/83913
[2]: https://github.com/Unity-Technologies/PostProcessing
↧