CG programming for non-programmers, lesson 8

For the eighth lesson, we are going to learn how to make edges.

It turns out that there is a shader function called step(a,b) that does this, where a and b are the two arguments to the function.

The step function returns either 0.0 or 1.0, depending on which of its two arguments is larger.

You can use the step function to make colors change suddenly. In other words, to make edges.

And if we can make edges now, then soon we will be able to make shapes, which will be really cool!

You can see this lesson by CLICKING HERE.

One Response to “CG programming for non-programmers, lesson 8”

  1. J. Peterson says:

    Some way to get error feedback would be useful – not knowing why the code stopped running could be a source of frustration for non-programmers.

    There’s also a thing against integers? The party stops until you put the “.” in.

Leave a Reply