I’m trying out Unity 2018.2 with the LW VR preset setup for my Gear VR (2017) on my Samsung Galaxy S9+ (Android Oreo 8.0.0). But when I try to build for Android it fails to compile some shaders.
I get messages like this:
Shader error in 'Hidden/Post FX/Fog': undeclared identifier 'sampler_CameraDepthTexture' at line 63 (on gles3)
Compiling Vertex program with STEREO_MULTIVIEW_ON
Platform defines: UNITY_NO_DXT5nm UNITY_NO_RGBM UNITY_ENABLE_REFLECTION_BUFFERS UNITY_FRAMEBUFFER_FETCH_AVAILABLE UNITY_NO_CUBEMAP_ARRAY UNITY_NO_SCREENSPACE_SHADOWS UNITY_PBS_USE_BRDF2 SHADER_API_MOBILE UNITY_HARDWARE_TIER2 UNITY_LIGHTMAP_DLDR_ENCODING
I also get similar messages for:
Shader error in 'Hidden/Post FX/Screen Space Reflection': undeclared identifier 'sampler_CameraDepthTexture' at line 129 (on gles3)
Shader error in 'Hidden/Post FX/Motion Blur': undeclared identifier 'sampler_CameraDepthTexture' at Assets/PostProcessing/Resources/Shaders/MotionBlur.cginc(90) (on gles3)
Shader error in 'Hidden/Post FX/Uber Shader': undeclared identifier 'sampler_CameraDepthTexture' at line 190 (on gles3)
Shader error in 'Hidden/Post FX/Depth Of Field': undeclared identifier 'sampler_CameraDepthTexture' at Assets/PostProcessing/Resources/Shaders/DepthOfField.cginc(81) (on gles3)
Shader error in 'Hidden/Post FX/Ambient Occlusion': undeclared identifier 'sampler_CameraDepthTexture' at Assets/PostProcessing/Resources/Shaders/AmbientOcclusion.cginc(106) (on gles3)
Shader error in 'Hidden/Post FX/Temporal Anti-aliasing': undeclared identifier 'sampler_CameraDepthTexture' at Assets/PostProcessing/Resources/Shaders/TAA.cginc(70) (on gles3)
It also outputs this:
UnityEditor.BuildPlayerWindow+BuildMethodException: 8 errors
at UnityEditor.BuildPlayerWindow+DefaultBuildMethods.BuildPlayer (BuildPlayerOptions options) [0x0021f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:187
at UnityEditor.BuildPlayerWindow.CallBuildMethods (Boolean askForBuildLocation, BuildOptions defaultBuildOptions) [0x0007f] in C:\buildslave\unity\build\Editor\Mono\BuildPlayerWindowBuildMethods.cs:94
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
If I remove OpenGLES3 and only build using Vulkan the shaders compiles but then the per eye rendering and rotation tracking does not work, but that’s another issue.
Any ideas of how to fix these shader errors?