Search Unity

RawImage acts weird in webgl build

Discussion in 'Web' started by diekeure, Nov 24, 2015.

  1. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    I have a rawimage in my ui, where I assign the texture via code:

    Code (csharp):
    1. public class Test : MonoBehaviour {
    2.    public Texture2D source;
    3.    public RawImage image;
    4.  
    5.    void Start () {
    6.     image.texture = source;
    7.     image.SetNativeSize();
    8.   }
    9. }
    (it's more complex than this, but this reproduces the bug)

    In the editor or windows/webplayer build it looks like this:



    In a webgl build it looks like this:



    Someone an idea what's going on?

    (Unity 5.2.2p2)
     
  2. Marco-Trivellato

    Marco-Trivellato

    Unity Technologies

    Joined:
    Jul 9, 2013
    Posts:
    1,654
    It might be a bug related to the Wrap Mode texture state. Would you mind submitting a bug report with your project ?

    can you reproduce it in the Editor if you launch unity with -force-gles20 argument ?
     
  3. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    Filed a bug report: 747302

    I'll try the editor later this evening.
     
  4. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    Tried it with the argument (<OpenGL 4.2 core profile> in the title bar), image looks correct so no repro.
     
  5. jonas-echterhoff

    jonas-echterhoff

    Unity Technologies

    Joined:
    Aug 18, 2005
    Posts:
    1,666
    @alexsuvorov has fixed a related bug for 5.4. We will check if it's the same issue. Is the texture non-power-of-two?
     
  6. diekeure

    diekeure

    Joined:
    Jan 25, 2013
    Posts:
    221
    Yes, 288x352px