I am working on a pre-rendered background setup in URP where I inject a pre-baked depth texture (a Raw/non linear.exr) into the camera's depth buffer. The goal is to have 3D geometry correctly cull against this static background. This exr is exported from Unity itself, therefore its captured in DX12, and has reversed z buffer
This setup works perfectly in the Unity Editor (Video 1), geometry behind the pre-rendered depth is occluded as expected. I am also additionally drawing a color pass after depth before opaque to display the pre rendered image.
However, in the WebGL build running on Itch.io, the depth injection seems to be ignored or incorrect (Video 2); the 3D geometry renders with no culling and even the color pass becomes invisible. I was only able to recreate this issue in editor when I intentionally made depth inject shader throw an error. If that is true question is why is it happening on webgl? How can I make my shader compatible?