top of page

Waveforms in Shaders

Adding A Mask

 

Now if you want only a part of your texture to pulse glow, then we will need to add some masking functionality.

The following system multiplies a mask onto our sine wave, but in order for the mask to not make the rest black, you need to invert the mask, and multiply your texture by that, then add that result back on top of your masked sine result. This is a little complex, but you can arrange the nodes how they are shown below and it will get you going.

This set-up forms the basis for setting up an effect using sine waves, whether it is pulsing, or displacing your mesh using vertex offset, or interesting UV-panning effects.

This is what the result ofthe shader above looks like in real-time.

A pretty regular, standard pulse.

I could end the tutorial here, but if you would like to learn about how to create more interesting patterns than a standard in-and-out pulse, then continue on to the next page.

Be warned, there is a little more complex mathematics there, but it's not too bad and it can lead to some awesome patterns.

bottom of page