Search Unity

Sprite on Android with ETC2, and OpenGL 3.0 Does Not Work On Fire TV

Discussion in 'Android' started by RvBGames, Apr 23, 2014.

  1. RvBGames

    RvBGames

    Joined:
    Oct 22, 2013
    Posts:
    141
    Sprites are not working on Amazon Fire TV (Android) when ETC2 compression is selected, and graphics level is set to OpenGL ES 3.0.

    Has this been fixed? If so, where can I get it? If not, is there a work around?
     
  2. RvBGames

    RvBGames

    Joined:
    Oct 22, 2013
    Posts:
    141
    Okay, I almost have a work around completed. Using the built in shaders (http://unity3d.com/unity/download/archive) I modified the Sprited-Default.shader, created a material and applied it to all our sprites. However, it appears that if I try to make use of [PerRendererData] the shader won't work. I have to drag the sprite texture into the material texture in order to get it to work.

    Anyone know why this is?

    I suspect that removing [PerRendererData] and dragging the texture onto the material in Inspector may load the texture twice :|

    Can anyone comment on this?
     
  3. RvBGames

    RvBGames

    Joined:
    Oct 22, 2013
    Posts:
    141
    Sprites are finally working on the Amazon Fire TV with OpenGL ES 3.0. We had to add a script to each sprite that sets the mainTexture on awake:

    Code (csharp):
    1.  
    2. public class SpriteShaderSetup : MonoBehaviour
    3. {
    4.     void Awake()
    5.     {
    6.         SpriteRenderer spriteRenderer = GetComponent<SpriteRenderer>();
    7.  
    8.         if (spriteRenderer != null)
    9.             spriteRenderer.material.mainTexture = spriteRenderer.sprite.texture;
    10.     }
    11. }
    12.