Transcript from the "Color Interpolation with mix" Lesson
>> Okay, so this is not exactly but we're learning a little bit more about some of these circles and how to draw circles in a shader. One other thing we'd like to do here is maybe instead of using black and white, we would like to introduce some color.
[00:00:37] We're gonna use that color, where all the black is, and then we're gonna modulate the color towards some other color where all the weight is. So, down here once we define our mask, we're going to create a new vec three. Let's call it fragColor just like this. We're going to say the fragColor is equal to mix.
[00:00:59] Whatever color you want to replace the black with, so let's say we're going to use color, which is the uniform. And then the next one is whatever the circle color should be, let's say, just leave it as white for now. And then we're going to use the mask value to interpolate from the first parameter to the second parameter.
[00:02:01] So, when this value is zero, it's gonna use the first parameter. When this value is 1, it's gonna use the second parameter which is white. That's why I can't see anything. When this value is exactly in between 0 and 1, it's going to use some sort of blended version between the color in between pure white.
[00:02:21] And so this is called interpolation, or linear interpolation actually is what it's called. So we're interpolating from A to B using the mask value. Because the mask value is also between zero and the mask value is zero. When we're outside or inside of the circle depending on whether we have it inverted or not.
[00:02:38] And then it's one, on the other side.