white balance shader
the shader make the white balance effect that look samiler to the unity effect
where the effect is wraping between 2 gradient colors (warm, cool)
warm is 1
cool is -1
you can add the shader to ColorRect node and it will work fine for any thing under it
I just edit the GDQuest Gradient Map Shader video so i can use it in any scene
without adding it for every single sprite and in the same time it wrabs between 2 colors
you need to add the gradient colors by your self and put it in the shader param
(you can learn how to make the colors from this video )
then change the mix_amount value to 1 for warm or -1 for cool
Shader code
shader_type canvas_item;
uniform sampler2D warm_color: hint_black;
uniform sampler2D cool_color: hint_black;
uniform float temperature = 0;
void fragment(){
vec4 input_color = textureLod(SCREEN_TEXTURE, SCREEN_UV, 0.0);
float grayscale_value = dot(input_color.rgb, vec3(0.299, 0.587, 0.114));
vec3 sampled_color;
if (temperature > 0.0){
sampled_color = texture(warm_color, vec2(grayscale_value, 0.0)).rgb;
COLOR.rgb = mix(input_color.rgb, sampled_color, temperature);
}
else{
sampled_color = texture(cool_color, vec2(grayscale_value, 0.0)).rgb;
COLOR.rgb = mix(input_color.rgb, sampled_color, temperature * -1.0);
}
COLOR.a = input_color.a;
}
blue green and red should not be visible?
no
it’s change the color by the value you put in the temperature
so you can make the scene look warm or cool