I’ve changed _AlphaCutoff for HDRP/Lit via C# like so:
Material output;
output.SetFloat("_AlphaCutoffEnable", alpha_threshold);
output.SetFloat("_AlphaCutoff", alpha_threshold);
output.SetFloat("_AlphaCutoffShadow", alpha_threshold);
Hit play and the cutoff doesn’t work, however instantly upon clicking the material in the inspector (while still running in play mode), the cutoff sorts itself out and falls into effect. Apparently this is a known issue:
So I added the lines from the link above.
output.SetFloat("_Cutoff", alpha_threshold);
output.SetOverrideTag("RenderType", "TransparentCutout");
output.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.One);
output.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.Zero);
output.SetInt("_ZWrite", 1);
output.EnableKeyword("_ALPHATEST_ON");
output.DisableKeyword("_ALPHABLEND_ON");
output.DisableKeyword("_ALPHAPREMULTIPLY_ON");
output.renderQueue = 2450;
Still doesn’t work with the new HDRP. Anyone know the alternative?