Search Unity

Texture Alpha Source Setting (Unity 5.5)

Discussion in 'General Graphics' started by CaelumNoctis, Jan 19, 2017.

  1. CaelumNoctis

    CaelumNoctis

    Joined:
    Nov 3, 2016
    Posts:
    26
    We're in the optimization phase of our game and we've gotten pointers towards transparency/alpha in textures/sprites being quite costly to render. So I've checked out the 'Alpha Source' setting on our Textures and tried to change it to 'None' from 'Input Texture Alpha'. The thing is, it seems to do nothing. Profiler showed no change and there are no visible changes. Anyone know what this setting does?

    Also, if Alpha Source is set to 'None' you can't change 'Alpha Is Transparency', but it still seems like the Texture is still using whatever 'Alpha Is Transparency' is set to (see photos). Bug?

    (Nothing more infuriating than getting a big flashy 5.5 update with settings that don't work/do anything...)
    Alpha.png
    NoAlpha.png
     
  2. mingwai

    mingwai

    Small Graphics Potato Unity Technologies

    Joined:
    Jan 16, 2017
    Posts:
    52
    What shader or what material are you using with this texture?
    If you are using a transparent material (shader), whether your texture has an alpha channel or not it will still be treated as transparent object which causes your performance problem.
     
  3. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
    The texture itself using / having alpha is almost irrelevant to performance, it's purely if the shader & material being used by the sprite is considered to be opaque or not. If you have a sprite texture with no alpha and use it with the default sprite shader it will be just as expensive to render as a sprite texture with alpha, and even possibly more so as Unity won't be able to pack that sprite as efficiently.

    You're probably going to want to look into something like SpriteSharp.

    https://www.assetstore.unity3d.com/en/#!/content/37599
     
    theANMATOR2b likes this.
  4. CaelumNoctis

    CaelumNoctis

    Joined:
    Nov 3, 2016
    Posts:
    26
    Alrighty. Thanks for the answers.
     
  5. CaelumNoctis

    CaelumNoctis

    Joined:
    Nov 3, 2016
    Posts:
    26
    Will something like SpriteSharp work with the default sprite shader then or will it only help if I also fix a better shader/material? :eek:
     
  6. bgolus

    bgolus

    Joined:
    Dec 7, 2012
    Posts:
    12,343
  7. UDN_30011711-3d42-4608-a55a-5bf3a3109e16

    UDN_30011711-3d42-4608-a55a-5bf3a3109e16

    Joined:
    Nov 23, 2016
    Posts:
    6
    You can use mobile shaders. Try Mobile - Particles - Alpha Blended shader . It is less costly.