URP - Transparent shader causes buggy rendering

Hi Community,
I am trying to implement dithering to terrain when my character is under some cover, i want that terrian to slightly dither. I have created a custom graph and set the graph to Surface = “Transparent” and Material “Lit”. my script works and the dithering works as expected however i get some really weird rendering when using transparent URP shaders that are Lit.

As soon as i apply a shader or any shader that is transparent Lit to my mesh render all of the objects seem to bug out. If i change the shaders Material setting from Lit to Unlit the see through buggy render seems to go away, which is telling me that this may be a lighting or shadow issue.

Any assistance would be apricated as i am kind of stuck on this.

What it should look like:

What it currently looks like using Lit transparency

Unlit(no holes and the whole mesh seems to render)

Graph:

Just an update, i found that the issue is due to the a depth rendering problem with Transparent rendered materials. For some reason URP does not handle transparent stuff well.

Hacky possibly very bad fix:
Zbuffer is a variable that is turned off by default but when i open up the c# generated code of the URP and i change the ZWrite method to True the poorly rendered terrian is fixed.
7173169--859696--upload_2021-5-25_20-33-29.png

Has anybody found a less dodgy way to fix this depth rendering problem on transparents?

I have never never never ever seen the Alpha Blend Operation being used successfully.
ZTest Less might help you avoid some zfighting in the geometry currently being rendered.

If it works it works even if it is hacky. Because transparency is not sorted as accurately in realtime as opaque meshes this often calls for hacky solution.

But this opens up the question if you dither it why not stay opaque. Fully opaque pixels would still sort accurately based on the depth buffer while non visible would let you see through. Anti aliasing will take care of the rest. Foliage is often blended this way too (I believe even in witcher3 but I am not sure)
I worry much more about how you differentiate between what geometry should be see through and which should keep being entirely opaque (raycast in screenspace to the player could make sense if you have fairly accurate colliders, and then switch materials based on that).

Have you considered reversing the entire logic of your problem though. Render the character mesh a second time on top of the rocks? Because there is a super simple tutorial on how to achieve that effect

Thanks for the video suggestion, I guess the main reason why i want transparency is because its a top down game with enemies running around. I tested out your suggestion a while back but i found it just a bit jarring\lame. Thinking about your suggestion further, i think adding the shader to dropped items\enemies might make it better, and by the looks of the video his see through walls shaders look far better than mine.

Here is what it looks like after hacking at the shaders generated code turning zwrite on and then slightly adjusting the opacity on all my rock mesh. I am kind of surprised

zwrite on and ztest less basically prevent rendering of all interior and backside polygons which creates the effect you would usually expects from simple transparency (no double drawing) so indeed yeah that looks actually pretty solid.