Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

[Found solution] GUI.DrawTexture shows texture half transparent and with wrong colors

Discussion in 'Immediate Mode GUI (IMGUI)' started by Cherno, Nov 1, 2016.

  1. Cherno

    Cherno

    Joined:
    Apr 7, 2013
    Posts:
    515
    I never experienced this before so I thought it might be a problem with the newer Unity versions.

    When I use GUI.DrawTexture, the texture that shows is about half transparent, and the colors are wrong. It looks like the blue channel is set to 0 (magenta becomes red, light blue becomes green, etc.). This happens even with file formats that don't support transparency themselves, like BMP. The images all have no transparent pixels and no alpha channel, just a normal image.
     
  2. Cherno

    Cherno

    Joined:
    Apr 7, 2013
    Posts:
    515
    Just found the answer. The whole OnGUI function got scrambled by a line drawing script I had going on that used colors other than white.