I added the post processing stack with a depth of field effect recently and noticed that not all shaders of mine write in the depth buffer. I also noticed, that fallback shaders do handle that problem for me. I do have some shaders, that change the geometry and rotation of the object. So I’m wondering:
How can you write into the depth buffer (In forward rendering mode)? I did find this topic, but sadly this is no clear solution for me. Is there any special tag I need to use, or do I have to use Depth textures? I’m developing for mobile, so I’m looking for a performant solution, which should be out there. The unity shader manage to do it after all as well.
I’m not sure, but if you still interested, I just added this after main pass, and got depth like on builtin shaders, dont know if it’s right way to do it, but worked for me so far. Red things - my own shader with vertex and fragment programs, no special tags except the one below.