Why is the add node not working as expected in shader graph?

Hi, I am writing shaders using LWRP 2019.2.9f1 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 from Unity 2018.2 to similar ones using Shader Graph.

Here is the graph:

Here is the isolated result from the gradient (top input of add node):
5112209--504647--gradient.png

Here is the isolated result from the background color (bottom input of add node):
5112209--504650--color.png

Here is the actual result:
5112209--504653--result.png

Here is what is expected:
5112209--504656--expected.png

All I am trying to do here is a simple add function.
For example, adding a pixel from the gradient near the center (0.8,0.8,0.8) with a pixel from the background which may be (0.25,0.25,0.5) should result in a white color (1,1,1) but it looks like I am getting a grayish color here. But from what I am seeing, the only pure white is in the exact center which doesn’t make sense to me.

To find the expected result, I tested using an image editing program with a simple additive blend mode between the gradient and the background color.

Does anybody know why this might be happening? Thanks - Jon

I’m not sure if I’m following you, but I think I know what might be the problem here;

If I combine your two images together with Add function in Unity, I do get a bright image with a blob in the center, as expected. But my color space mode happened to be Gamma. Are you sure your project’s color space mode is correct, i.e. the same as it was? With Linear, you can expect to get that tiny white blob. Also, if you had changed your texture (if you used textures) sRGB mode toggle in import settings, that would affect quite drastically the result too.

1 Like

Thank you so much, you’re a life saver. This was really bugging me. It turns out I was working in gamma space in my other project while this was in linear space.

I don’t know too much about gamma vs linear space but according to this page, https://docs.unity3d.com/Manual/LinearRendering-LinearOrGammaWorkflow.html , maybe I should stay in linear and find another way to get that glow light effect.

Thanks again

Was able to get the same results in linear space with using a “Gamma Add” node instead of the standard “Add”. I found online how to convert from linear to gamma, add, then gamma to linear.