alelievr / HDRP-Custom-Passes

A bunch of custom passes made for HDRP
MIT License
1.25k stars 136 forks source link

overwrite depth written by RenderWithNormalBuffer #59

Open Milk-Drinker01 opened 3 months ago

Milk-Drinker01 commented 3 months ago

Hi! im trying to create a scope effect in HDRP that doesnt need 2 cameras to render. To do this, i am using the hd scene color node, which means i need to make sure the inside of the scope tube is not rendered over the scope image. i hoped to accomplish this in a similar way i did in URP; to not render the scope in the main pass, but rather use a custom pass to render the scope tube AFTER rendering the lens.

when i did this at first, the sight picture looked okay, but scene AO is being rendered over the scope model (which is on the transparentFX layer): AO over scope

Sight Picture OKAY

So then i found this project, which allows me to write to the normals buffer with a custom pass. this is great, it fixed the issue where AO is rendered over the scope model! but then this happened with the hd color node from shadergraph:

no ao over scope

sight picture broken

Im hoping someone might know how i can achieve the effect i want. thanks in advance!