I just use a custom node to sample the scene depth and render to screen in my postprocessing material. It works well in the editor even I switch to ES3 preview mode. But after I package the demo into my OnePlus6. It is broken. I listed some screenshots here:
Looks good in the editor.
Broken on my phone.
The strangest thing is when I attach to renderdoc. It shows it should be correct:
Does anyone know why the CalcSceneDepth cannot work on my phone?
This is the code in my custom node:
#if POST_PROCESS_MATERIAL
#if SHADING_PATH_MOBILE
return CalcSceneDepth(SvPositionToBufferUV(Parameters.SvPosition)) * 0.0001;
#else
return 0;
#endif
#else
return 0;
#endif