Search Unity

Question about blending modes for 2D mobile games

Discussion in '2D' started by alvaro_prieto, Mar 1, 2018.

  1. alvaro_prieto

    alvaro_prieto

    Joined:
    Feb 12, 2018
    Posts:
    12
    Hi :)

    I'm a beginner in Unity, and I'm developing a small 2D game for mobile devices (android). This is my first post.

    I'm using sprites, no lighting involved, just sprites. I was wondering if it is possible to fake glow and darkness by adding some sprites with different blending modes. I'm looking for something similar to multiply or overlay (for dark areas and shadows) and color dodge or screen (for glowing objects). I don't care too much if they are exactly the same as those Photoshop's blending modes, a similar approach will do.

    I know that there is no such concept as "blending modes" in Unity and I have been reading several post and articles about using shaders to mimic those blending modes. I know that there are also several paid assets in the store to achieve that, but if possible I would prefer not to buy anything.

    I have several questions:

    1. I've read that using shaders in mobile devices is a performance nightmare, ¿is that true? ¿does that mean that I should forget about blending modes for mobile?
    2. ¿How can I make a sprite look like "multiply" or "color dodge" blending modes? (I want those sprites to blend with other elements in the scene behind them)
    3. I also used some sprites with an additive shader applied to their material to fake positive color tinting with its own base material color (the default material does that with a multiplicative blending). Is it wrong to use different shaders/materiales instead of Default/Sprite when targeting mobile due to performance issues?

    Thank you and sorry if my questions are a bit confusing, I come from a AS3/Starling background were blending modes are easy to use by default, so it seems strange that I haven't found that on Unity yet being it much more powerful.
     
  2. AcidArrow

    AcidArrow

    Joined:
    May 20, 2010
    Posts:
    11,791
    Here : https://docs.unity3d.com/Manual/SL-Blend.html
    Multiplicative is multiply and I believe color dodge is additive. If you don't want any sort of lighting, make an unlit shader an try putting blend modes from that list in it (if you start creating a shader, you can ask for more info here, me and plenty of other people can walk you through).

    Or you could just use the ones in Particles. There's an additive and a multiplicative one.
    You can't not use shaders, so I don't know what you mean :)

    You should avoid stacking a lot of semi transparent stuff on top of each other, since fillrate can become a problem on certain devices. You may have to lower resolution a bit if you are fillrate bound.
    It's fine.
     
    alvaro_prieto likes this.
  3. alvaro_prieto

    alvaro_prieto

    Joined:
    Feb 12, 2018
    Posts:
    12
    Particle materials worked like a charm! You saved me a lot of time, thank you :)
     
  4. alpha_waves

    alpha_waves

    Joined:
    Oct 26, 2016
    Posts:
    3
    I've been trying to do this myself. I'm not sure how to use particle material as you suggested. Please could you give me the steps and screenshot(s) with the necessary settings?