Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

UI Textures look washed out in WebGL build

Discussion in 'WebGL' started by Raidenwins, Mar 8, 2022.

  1. Raidenwins

    Raidenwins

    Joined:
    Dec 18, 2012
    Posts:
    132
    I created a WebGL build a couple of days ago and when I ran it I noticed some of the UI textures look very washed out. In the image below you can see how the colors in the WebGL build look very washed out compared to the PC build. The problem is most evident with UI textures, but as you can see, the terrain behind the image is also washed out in the WebGL build.

    upload_2022-3-7_20-4-58.png

    My Unity version is 2019.2.5f1. This is an older texture and is displayed in the OnGUI method of a MonoBehaviour script, i.e. not in Canvas, like this:

    Code (CSharp):
    1. private void OnGUI ()
    2. {
    3.     GUI.BeginGroup (new Rect (PositionX, PositionY, SizeX, SizeY), MyTexture);
    4.     GUI.EndGroup ();
    5. }
    The problem above does not happen for textures displayed in Canvas, just for ones in an OnGUI method.

    Here are the import settings for the texture in question:

    upload_2022-3-7_20-15-50.png

    And below are the WebGL Player settings:
    upload_2022-3-7_20-17-47.png

    This happens on Chrome and Edge browsers. What could be the problem?
     
    Last edited: Mar 8, 2022
  2. Raidenwins

    Raidenwins

    Joined:
    Dec 18, 2012
    Posts:
    132
    In case somebody is curious, I resolved the issue above by setting the Color Space to Gamma.