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

is a UGUI image with a source image more performant than choosing none?

Discussion in 'General Discussion' started by Mike01923, Dec 29, 2020.

  1. Mike01923

    Mike01923

    Joined:
    Jun 19, 2015
    Posts:
    190
    All my buttons have about 5 images on them, just as decorations. All of them are rectangles, so I was wondering if it's better to use a small white square as a source image instead of choosing none?
     
  2. Murgilod

    Murgilod

    Joined:
    Nov 12, 2013
    Posts:
    9,686
    This is a micro optimization at best. You won't see any meaningful difference on even the slowest of deployable platforms if you see any difference at all, I'd wager.
     
    Ryiah likes this.
  3. Le_Tai

    Le_Tai

    Joined:
    Jun 20, 2014
    Posts:
    430
    No image is better. You'll need to be bandwidth bound first to be able to see any different in framerate. Even if you're bandwidth bound, you still need to use a rather high resolution image to cause frame drop.

    Theoretically, using no images should reduce power consumption IIRC.
     
  4. Ryiah

    Ryiah

    Joined:
    Oct 11, 2012
    Posts:
    20,004
    You mention how many images the buttons have but that's only half of the picture. We need to know the number of buttons you're working with too. Like @Murgilod said this is a micro optimization and any benefits only truly start to show up when working with large quantities.
     
    Last edited: Jan 1, 2021
  5. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,403
    As with every other performance related question, there is no reason to "wonder" whether X or Y performs better. You can simply measure it yourself!



     
    angrypenguin and Ryiah like this.