I'm trying to wrap my head around making shaders but I have no real coding experience. I've tried looking for a solution to my problem but I haven't found anything. Maybe I'm not phrasing it right? The problem is this: I have a script that looks like this, which takes a texture with values in a certain range and then changes the range of the values while keeping their relative positions.
shader Exp_Shader(
float tex = 0,
float OldMax = 1,
float OldMin = 0,
float NewMax = 1,
float NewMin = 0,
output float Result = 0,
)
{
Result = (((tex - OldMin)*(NewMax-NewMin))/(OldMax-OldMin)) + NewMin;
}
The problem is, that this works on greyscale textures but not on color. How can I add a color input and output to make this work?