I would like to achieve the following effect.
If two sprites overlap, the colors should blend in the overlapping area.
So, as in the following picture:
I also found a shader that comes close to it. The particles/additive shader.
However, this does not seem to display all colors accurately.
For example, if I have a color with R-G-B values r = 201, g = 255, b = 0
(a greenish-yellow color), this is shown as pure yellow, as seen in the following image.
I am still new to unity and have no idea of shader programming yet.
Is there perhaps a shader that can achieve the effect I want?
Or can you get the additive shader to display the colors correctly?
If someone needs something similar, I have a solution now.
Just download the code for the sprite/default shader and
replace the line “blend one OneMinusSrcAlpha” with “blend one One”.
Then set the alpha to 255 in the color settings.
However, the color is too dark. I don’t know how to fix this, because I don’t know about shader programming.
My workaround is to just put two sprites with the new shader and the same color consecutively. Then the color has the correct brightness.
Behind it you can put a sprite with a simple sprite/default shader with black color, so that the sprites with the new shader do not mix with the background.
This may not be the most elegant solution, but it works.