Hello,
This is somewhat related to my recent question regarding lightmap shaders.
I have a value of ambient lighting to represent a night-time colour.
I would like to fade this over time following to white representing a peak daytime colour.
I want to use the value of 0.5 * sin(theta) + 0.5 to fade between the two colours inside my shader; in order to implement a simple day/night cycle, my intention:
void main()
{
vec3 white = vec3(1, 1, 1);
vec3 ambientLight = vec3(0.2, 0.2, 0.2);
//interpolate based on current value of 0.5 * sin(theta) + 0.5
vec3 timeOfDayColor = InterpolateColour(ambientLight, WHITE);
//rest of shader...
}
I have been trying to find a straightforward tutorial on how to interpolate between white and my ambient light colour to implement the
InterpolateColour
method above, however i have had no success, could anyone help me or point me in the right direction?
Thanks