I am having trouble creating a shader that behaves like the ‘Color’ layer effect in Photoshop. I have Googled my ass of to find a decent shader for this but it lead to nowhere.
What I want to achieve is the following: I have gray-scaled images for my menu buttons and I want to colorize the gray areas in the image. The default shaders like ‘Transparent/Diffuse’ is almost what I want except that it also colorizes the white pixels, and I only need the gray areas to colorize.
I am stuck with this. Is there anybody who can help me? I basicly need a shader with one texture input and one colour input that automagicly combines the two into what I need.
In the following image you can see what I am trying to achieve:
Your codes are not giving me correct result for replicating the "Color" blending mode of Photoshop. I am Googling for a solution, and I have not found any yet. Somebody can help me?
“Overlay” is not “color” these act very differently in Photoshop. Overlay is additive, it makes tings lighter (closer to white), color leaves sum RGB value the same.
For example I need a shader that makes things monochrome. In photoshop I create a white colour layer and issue blending mode “color”, this makes it grayscale. Next I make another color blending layer with a desired colour.
"I need" is not something we want to read on Unity Answers. Feel free to hire a Unity Expert on Unity Connect if you want someone to do the job for you without putting some effort into solving your own problem first of all.
The formula is like this: Input = int( (R + G + B)/3) = iR iG iB --- this gives approximated grayscale value Shader colour = sR sG sB --- simple rgb value input Now do for each color: R = iR + sR; iG - sR/2; iB - sR/2 G = iR - sG/2; iG + sG/2; iB - sG B = iR - sB/2; iG - sB/2; iB + sB Values capped to 255 of course.
Your codes are not giving me correct result for replicating the "Color" blending mode of Photoshop. I am Googling for a solution, and I have not found any yet. Somebody can help me?
– pvzkiller