How to layer two nodes? (like photoshop layers?)

Hello,

New to shader graph, there is an apparently simple issue that I cannot seem to be able to solve…
I’m trying to have some colored&animated noise on top of a sprite, to create an “electrified” effect.
But I cannot find a way to blend them together… I would like the purple to be added on top of my sprite and the blacks to be left out. Like if the purple noise was a photoshop layer added on top of my character layer.
I’ve tried every blend modes but no satisfying results. It kinda works on dark areas but on white, it’s barely to no visible.
Can anyone help ? :slight_smile:

Thanks !

Which blend would you use in Photoshop to get what you want? All of the blend modes in the Blend node are using the same math Photoshop is.* Though honestly I can’t think of a blend mode that would let a color with a black background blend onto a white layer properly. You probably want to either have a white background to your effect texture and use multiply or one of the “light” blends (hard light, linear light, etc). That or you need your effect texture to be a solid color and use the alpha to blend between them. The Overwrite blend mode of the Blend node is equivalent to Photoshop’s “Normal” layer blend type.

  • Photoshop defaults to doing all of its blends in sRGB color space (aka Gamma Color Space). Unity is going to default to doing its blends in whatever color space you have your project setup to use, which usually defaults to Linear these days. If your project is using Linear Color Space, to 100% match Photoshop you’ll have to use the Color Conversion node to convert the input color values from “Linear” and “RGB”, do the blend, then convert the output of the blend back from “RGB” to “Linear”. But this is only needed if you need to perfectly match Photoshop, which arguably does color blends wrong to begin with.

Thanks for your replay bgolus.
What I’m trying to achieve is this (file attached name Photoshop.png)

As you say, I believe that Overwrite would be to right blend mode. But when I use overwrite, the black part of my effect texture just covers everything … (file attached BlendOverwrite).

I would like that black part to be transparent so the enemy sprite behind is still visible but this is what I don’t know how to achieve :-/


I’ve the same problem, did you solve it?

I guess I missed this reply, or had hoped the OP would figure it out on their own and post a reply, but the short version is you need an alpha (aka opacity mask) to use to blend between the two images. You can either use the Blend node set to Overwrite, or a Lerp (Linear Interpolate) node, they’re the same thing.

The thing the OP was missing was in the graph he posted he’s clearly multiplying a black and white pattern with a solid color to get that purple effect. If they connected the black and white pattern into the Opacity, and solid color into the Blend inputs of of the Blend node it would work as they wanted.