I’m trying to enable alpha clipping in my custom shader for foliage and the like. However, I can’t seem to make it work for discarding pixels in the depth and shadow passes.
I’m using the clip function to discard the pixels and returning the correct alpha value, and I’m using the passes like so:
UsePass “Universal Render Pipeline/Lit/ShadowCaster” UsePass “Universal Render Pipeline/Lit/DepthNormals” I tried enabling _ALPHATEST_ON which those passes seem to depend on, but it still doesn’t work.
The alpha clipping works as expected when using built-in shaders or the shader graph. I can’t share more of my code unfortunately. Here’s some of the top settings that might help, just trying a bunch of things that don’t seem to work.
Tags { “RenderPipeline”=”UniversalPipeline” “RenderType”=”Opaque” “Queue”=”Geometry” } Pass { ZWrite On ZTest LEqual Blend SrcAlpha OneMinusSrcAlpha AlphaToMask On ColorMask RGBA
I can’t use the transparent render type, and in the built-in shaders and shader graph I don’t have to.
Is there anything obvious I might be missing?