运行时修改Standard shader的Mode

    xiaoxiao2024-05-15  2

    不能通过只设置Mode来改变,需要如下八行代码 Material m = new Material(Shader.Find("Standard")); m.SetFloat("_Mode", 2); m.SetInt("_SrcBlend", (int)UnityEngine.Rendering.BlendMode.SrcAlpha); m.SetInt("_DstBlend", (int)UnityEngine.Rendering.BlendMode.OneMinusSrcAlpha); m.SetInt("_ZWrite", 0); m.DisableKeyword("_ALPHATEST_ON"); m.EnableKeyword("_ALPHABLEND_ON"); m.DisableKeyword("_ALPHAPREMULTIPLY_ON"); m.renderQueue = 3000;

    转载请注明原文地址: https://ju.6miu.com/read-1288607.html
    最新回复(0)