Page 1 of 1

Writing to depth buffer with SV_Depth

PostPosted: Wed Mar 27, 2019 1:18 am
by andr3warv
Hi, I've been using Amplify Shader Editor for several months now and I was wondering if there was any way to write to the depth buffer with SV_Depth within ASE or if it required writing the shader manually. I'm attempting to create a custom hair shader and wish to implement something similar to UE4's "per pixel depth' pin to avoid nasty polygon intersection artifacts (which would allow me to blend the hair cards using their heightmaps). I don't see any way to offset the depth other than the per-polygon depth in the properties panel though. Any help would be greatly appreciated.

Re: Writing to depth buffer with SV_Depth

PostPosted: Mon Apr 01, 2019 4:52 pm
by Amplify_Borba
Hello, thank you for getting in touch and for your support!

Due to a limitation in the surface shaders it won't be possible to accomplish this through them, however, in a vertex/frag template it should be possible although it would require some additional modification in order to ensure that it works.

The HD templates already have the necessary structures for this, but they're only used internally by the HD and we don't provide any port that can modify them.

Could you please provide further information regarding the context in which you want to implement this?
Are you looking to use it specifically in one of the new scriptable render pipelines?