Search Unity

  1. Unity 6 Preview is now available. To find out what's new, have a look at our Unity 6 Preview blog post.
    Dismiss Notice
  2. Unity is excited to announce that we will be collaborating with TheXPlace for a summer game jam from June 13 - June 19. Learn more.
    Dismiss Notice
  3. Dismiss Notice

Bug Small textures only display as transparent white

Discussion in 'Scripting' started by noonoox, May 17, 2024.

  1. noonoox

    noonoox

    Joined:
    Nov 15, 2014
    Posts:
    27
    Hello!

    I'm making a game that uses your phone as a jackbox-style controller, and I've started to add little minigames you can play. I want to send low-res screenshots of the minigame to the host so other players can spectate.

    To do this, I use ScreenCapture.CaptureScreenshotAsTexture() and then Graphics.CopyTexture() the portion of the screen containing the minigame.

    Unfortunately, I've hit a frustrating snag: In this code, when I set a RenderTexture or Texture2D to a resolution below 301x301, it only shows as transparent white! Does anyone know what causes this? Ideally I'd like to crunch the screenshots all the way down to 128x128 but that's way below the invisible threshold that causes this bug.

    Also, the minigames are played all using UI, so I can't just use a 2nd camera that renders directly to a small render texture.

    PS: Graphics.Blit() seems to ignore the "Offset" property when I try to manually scale & offset it

    Edit: By some sick twist of fate, after spending hours on this, it immediately started working as soon as I posted this thread :/ .... a happy ending, I guess?
     
    Last edited: May 17, 2024