diff --git a/Assets/Klak/Hap/Runtime/HapPlayer.cs b/Assets/Klak/Hap/Runtime/HapPlayer.cs index 83e2004..0eb5c42 100644 --- a/Assets/Klak/Hap/Runtime/HapPlayer.cs +++ b/Assets/Klak/Hap/Runtime/HapPlayer.cs @@ -164,7 +164,7 @@ void UpdateTargetTexture() // Material lazy initialization if (_blitMaterial == null) { - _blitMaterial = new Material(Utility.DetermineShader(_demuxer.VideoType)); + _blitMaterial = new Material(Utility.DetermineBlitShader(_demuxer.VideoType)); _blitMaterial.hideFlags = HideFlags.DontSave; } diff --git a/Assets/Klak/Hap/Runtime/Internal/Utility.cs b/Assets/Klak/Hap/Runtime/Internal/Utility.cs index 26a41ae..90a9491 100644 --- a/Assets/Klak/Hap/Runtime/Internal/Utility.cs +++ b/Assets/Klak/Hap/Runtime/Internal/Utility.cs @@ -37,14 +37,12 @@ public static TextureFormat DetermineTextureFormat(int videoType) return TextureFormat.DXT1; } - public static Shader DetermineShader(int videoType) + public static Shader DetermineBlitShader(int videoType) { - switch (videoType & 0xf) - { - case 0xe: return Shader.Find("Klak/HAP Alpha"); - case 0xf: return Shader.Find("Klak/HAP Q"); - } - return Shader.Find("Klak/HAP"); + if ((videoType & 0xf) == 0xf) + return Shader.Find("Klak/HAP Q"); + else + return Shader.Find("Klak/HAP"); } } }