Skip to content

Commit

Permalink
Fix HAP Alpha issue with RT (#15)
Browse files Browse the repository at this point in the history
  • Loading branch information
keijiro committed Apr 12, 2019
1 parent 5e70d3a commit e8f037f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Assets/Klak/Hap/Runtime/HapPlayer.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
12 changes: 5 additions & 7 deletions Assets/Klak/Hap/Runtime/Internal/Utility.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");
}
}
}

0 comments on commit e8f037f

Please sign in to comment.