Why does unity 2020.1.10 freeze on android build for Oculus?

1.1k Views Asked by At

I get a number of these: undeclared identifier 'sampler_CameraDepthTexture' at Assets/PostProcessing/Resources/Shaders/MotionBlur.cginc(90) (on gles3) I get a number of these in ???.cginc at different line numbers and am at a loss as to where to start. Do these cause problems in the build process? I can supply more info if need be. I did not want to fill this post post with obfuscative volume. There are no errors displayed in the Edit/preferences/External tools. Thank you.

1

There are 1 best solutions below

0
On

This is only a guess with the limited information you provided.

Probably DepthTexture is not supported for this platform or is currently disabled. If you remove the MotionBlur shader from your game and try again and no new errors come up - you can be sure that this is an issue and try to fix the shader code.

If you are using URP you need to enable DepthTexture in the asset menu for URP

enter image description here

If your shader is written manually, you should move to the shader graph.

As for the errors, if the game produces a working binary, then there will be 2 downsides:

  • Your game will not display MotionBlur shader, it will either turn pink or won't display at all
  • Your game will be slower due to the constant spam of error logs.

Note that DepthTexture is VERY expensive on mobile!