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. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

Bug Weird behavior with few PNGs in unity. Transparency is disturbed.

Discussion in 'Formats & External Tools' started by WaqasHaiderDev, Feb 4, 2021.

  1. WaqasHaiderDev

    WaqasHaiderDev

    Joined:
    Apr 17, 2020
    Posts:
    116
    Hi, this happens to me many times when I import images into unity with transparency. As you can see, In preview window, still there is transparency but when I drag the image into scene, its all disturbed. What could be the issue?
     
  2. WaqasHaiderDev

    WaqasHaiderDev

    Joined:
    Apr 17, 2020
    Posts:
    116
    Here is the image
     

    Attached Files:

  3. fffMalzbier

    fffMalzbier

    Joined:
    Jun 14, 2011
    Posts:
    3,269
    Look like in the scene the whole mesh is drawn might be worth checking the material that is used to render the image.
     
  4. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    194
    Apart from the material, I'd also check the import settings, but just below the part you are showing us. There's an advanced foldout. Make sure that Alpha Source is set to Input Texture Alpha and also check Alpha is Transparency(although at least for Sprite Renderer with the Sprite-Default material, this doesn't seem to matter).
     
  5. WaqasHaiderDev

    WaqasHaiderDev

    Joined:
    Apr 17, 2020
    Posts:
    116
    upload_2021-3-4_19-47-33.png

    I even tried with custom material but still the behavior was same.

    Alpha is already marked as transparency. Please refer to original post of mine where I also showed the PREVIEW of the image where there you can see alpha channel in preview as well.

    More clarification is that the same sprites are shown correctly at higher resolutions but when I reduce resolution of the image i.e. by reducing max size of the image, this issue occurs and transparency is disturbed.
     
  6. npatch

    npatch

    Joined:
    Jun 26, 2015
    Posts:
    194
    You're right. Question, first Unity version is this?
    Also for what it's worth, took an 8K png and set max res to 32x32 and 3px to unit. And applied a ridiculously small scale to it and it was fine on 2019.4.20.
    On the other hand, I see ETC2, so I'm guessing you're building for Android. Perhaps it's an issue with ETC2?
     
    Last edited: Mar 4, 2021
unityunity