Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice
  2. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  3. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How to modify lighting Blend Styles ?

Discussion in '2D Experimental Preview' started by Noadasi, Dec 11, 2019.

  1. Noadasi

    Noadasi

    Joined:
    Dec 11, 2019
    Posts:
    4
    Hello everyone,

    Last year, my teamate created a 2D light system from scratch. We were delighted to see that Unity incorporated an official one that work very well but, our own system had some features (mostly light shaders) that the new system does not offer.

    We are currently trying to take the best of both worlds and import our own light shaders into the official new Unity 2D light system. Unfortunately it isn't that simple, we could use a little help in that regard.

    So, in the new Unity system, inside the renderer, you can tell Unity which light shader the lights will be able to use (regarded as "Blend Styles") and you are limited in 4 slots. We want more. We tried to brute-force the code but adding more Blending Style caused the graphics to f*** up badly.

    That's one point.

    Secondly, these Blend Styles are currently limited to "Additive", "Multiply", "Substractive".
    Again, we want more of these, my teamates had created more for our old system but we have no idea where Unity putted these and how it interracts so to merge everything together is quite puzzling at the moment.

    Can you help us ?
     
    suxiangting likes this.
  2. Lili_873

    Lili_873

    Joined:
    Nov 7, 2019
    Posts:
    1
    Hmmm...

    Maybe using a derived class from Unity ones would make it possible ?
     
  3. Noadasi

    Noadasi

    Joined:
    Dec 11, 2019
    Posts:
    4
    Unfortunately, my teamate doesn't know how the Unity class works in the first place, so he cannot do that, any ideas ?
     
  4. Noadasi

    Noadasi

    Joined:
    Dec 11, 2019
    Posts:
    4
    Still in need for help... Anyone, please ?
     
  5. hidingspot

    hidingspot

    Joined:
    Apr 27, 2011
    Posts:
    87
    We're in a similar situation. The artist I'm working with likes to create lighting layers in photoshop with the "Overlay" blend mode, which gives a much nicer look. I've gone out of my way to create a system that let's us recreate that blend mode in Unity. It basically goes like this:
    - the main scene, minus lighting layers, is rendered into a RenderTexture
    - a custom ShaderGraph shader uses the blend node (which conveniently has an Overlay option) to combine the lighting texture with the scene colors from the RenderTexture above

    There are downsides to this approach though. It requires an extra camera/RenderTexture and a fair amount of added complexity. Also, to avoid even more cameras and render textures, I render all the lighting layers to the same camera/RenderTexture, which means the artist can't do fun stuff like mixing lights within the scene; all lighting effects are just rendered in front.

    It would be really wonderful if more blend modes were supported in the new Unity 2D lighting system!
     
    NotaNaN, suxiangting and Noadasi like this.
  6. Noadasi

    Noadasi

    Joined:
    Dec 11, 2019
    Posts:
    4
    That seems like a hell of an approach ! Indeed, more blend modes would be insane ! Or at least, if Unity wouldlike to explain how to add some custom modes, we could do the job by ourselves. I'll submit your idea to my teamate, though and I am VERY grateful to you for answering this topic ! Hopefully, if we are not the only ones interested, Unity will provide us with something to help our predicament.
     
  7. suxiangting

    suxiangting

    Unity Technologies

    Joined:
    Jun 12, 2020
    Posts:
    5
    Thank you for letting us know, Noadasi and Hidingspot! Just curious, what are some of your commonly used/ preferred blend styles? I'm hearing "Overlay" and what else?
     
  8. hidingspot

    hidingspot

    Joined:
    Apr 27, 2011
    Posts:
    87
    The artist on our current game uses the photoshop Overlay mode pretty exclusively when creating lighting effects. So that's the main one for us.
     
  9. suxiangting

    suxiangting

    Unity Technologies

    Joined:
    Jun 12, 2020
    Posts:
    5
    Thank you Hidingspot! I'll feedback this to the team. We are looking into making the Blend Styles more accessible and easier for more users. This is definitely moving up on our agenda. So feel free to let us know of any more suggestions like these in the meantime.

    P.S. I took a peep at your website and saw one of your games, "Welcome to Beacon Pines". Looking great!
     
    AzureMasters likes this.