- Home /
Why is the add node not working as expected in shader graph?
Hi, I am writing shaders in LWRP and I noticed that the add node is not working as expected in Shader Graph. I noticed this when trying to copy shaders I wrote a whole ago using Cg shaders to similar ones using Shader Graph.
I am only able to make two attachments so an example of the shader graph can be found in a post on the unity forms:
https://forum.unity.com/threads/why-is-the-add-node-not-working-as-expected-in-shader-graph.767807/
Here is the result of a white radial gradient added to a background color:
However, here is what is expected from adding the two layers:
Anybody has a clue on what's going on here?
Answer by RadonRaph · Oct 27, 2019 at 09:53 PM
Hello @Jonathan_L , I don't know why it doesnt work has expected but i think you can use the power node to make the same effect.
Yep, got the same exact effect by using power nodes to converting colors to gamma space, adding, then converting back to linear space. https://forum.unity.com/threads/why-is-the-add-node-not-working-as-expected-in-shader-graph.767807/
Answer by Jonathan_L · Oct 28, 2019 at 01:10 AM
Turns out I was working in linear color space instead of gamma space like the other project I was working one. I'm trying a series of power and multiply nodes to get that same flow effect and I think I'm getting close to that same effect @RadonRaph. Thanks