CG programming for non-programmers, lesson 23

For lesson 23 we learn how to mix colors. Actually, we can use it to mix pretty much anything. We are just using color as an example.

The mix(a,b,t) function uses its third argument t to create a mixture of a and b. When t is 0.0 the result is a. When t is 1.0 the result is b. When t is anything in between we get a mixture of a and b.

Here we are using it to create a mysterious fog cover over our moon at night. The shape of the fog cover is created by a noise texture, and the value of that noise texture is controlled by x, y, z and uTime. The use of uTime in defining the noise texture is what makes the fog animate.

You can see this lesson by CLICKING HERE.

Leave a Reply

Your email address will not be published. Required fields are marked *