Search Unity

Rendering GUI components additive

Discussion in 'Immediate Mode GUI (IMGUI)' started by Maph, Oct 14, 2009.

  1. Maph

    Maph

    Joined:
    Sep 19, 2009
    Posts:
    55
    Hi,

    I'm using Unity for an after-hours 2D-game, and I need to find a way to render some GUI components with additive transparency.
    I've searched high and low, and I must be missing something obvious on how to do this!
    Going hardcore and using polygons is an option ofcourse, but I'd rather use UnityGUI, it's so much easier to set up!

    If anyone can help me with this, that would be absolutely grand!

    K.
     
  2. andeeeee

    andeeeee

    Joined:
    Jul 19, 2005
    Posts:
    8,768
    Welcome to the forum!

    You can render transparent areas in GUI elements just by using the right alpha on the image, but additive transparency (like Photoshop's blend modes) isn't directly supported. You don't actually get to choose which shader will be used to render GUI elements, so there isn't really a way around this.

    I think you may just have to go hardcore and use polygons ;-)
     
  3. Maph

    Maph

    Joined:
    Sep 19, 2009
    Posts:
    55
    Thanks!
    I've been following these boards a while now, and there's loads of great tips around here. :)

    Going for polygons is going to be a bit of pain as the game requires pixel perfect elements.
    But I guess I'll have to manage with standard alpha blending!

    Maybe some day the great guys at Unity will give us access to the GUI material/shader settings!
    Or enable us to declare a material/shader on GUIStyles, that would awesome.

    Thanks for the reply though!
     
  4. raaan127

    raaan127

    Joined:
    Dec 9, 2019
    Posts:
    31
    I know this is a very old post, i was just looking for a way to use addiive in canvas and I saw this post. After looking around for a while, I found it and want to share.
    I found a post about UI particle, there're shaders in the package and I use the additive one (UI/particle/additive) as Image's material's shader and it works.

    upload_2020-9-14_10-52-12.png upload_2020-9-14_10-48-15.png