![]() |
|
U & V Effects 1: Stripes |
| Home | Tutorial Links | My Tutorials | Sample Materials | Freebies |
U AND V NODES USED TO CREATE EFFECTS: STRIPESU and V are probably at their most powerful when used to create special effects using the maths nodes. Here they are being used more to give an idea of direction than for the detailed gradient, to produce stripes, bars or even circlesUV StripesThe first special effect we will look at are stripes. In this first example, we will produce horizontal stripes, but the direction of the stripes can be altered using any of the modifications in the previous article. Stripes require two extra nodes. First, the Mod maths function will produce smooth bands. The Mod function divides Input 1 by Input 2, then returns the remainder. Here, the V variable is plugged into Input 1, with input 1 set to 10. This will get us 10 bands.V runs from 0 to 1. Multiplied by ten this gets us 0 to 10 as the overall range, but the Mod function only returns the remainder, so 5.2 divided by 1 become 5, remainder 0.2., as does 1.2, 3.2, 4.2 and so on. If you want more or less bands alter Input 1. Don't forget that the size of your model will affect the size of these bands. Ten bands on a glove will be thin bands, but the same ten bands on a cavern wall would be massive. These ten smooth bands are then plugged into the round maths function, which rounds up fractions over .5 and rounds down those under 0.5. This gets us ten black and ten white bands. To make the white bands thicker, increase value_1 of the Round Node. Remember that if you go above 1.5, then the round function will produce three bands (The maximum input of 1, multiplied by 1.5 produces a value of 1.5 which will round up to 2), which could be important if you plan to plug the output from this into another node. To make the bands thinner, decrease value_1. If you go below 0.5, then the bands will disappear as the maximum input of 1, multiplied by 0.49, would only reach 0.49 and be rounded down to zero). This sample material uses the U node to produce vertical stripes, which then control the blender node producing a two colour striped shirt. The number of stripes can be changed by altering Value_1 of the Mod node. Different items of clothing would need different settings here to produce decent results.
A Single StripeSometimes you might want to pick out a single part of a material (perhaps for the blender node). You could draw a black and white texture map with the stripe, but that is very memory inefficient. Instead, you can use the U or V nodes combined with some simple maths. This has the advantage that you can easily fine tune the edges, or even animate it.This trick relies on the Step maths function. This compares the two inputs, and returns 0 if value_1 is bigger or 1 if value_2 is bigger. Here, we are plugging our U variable into value_2 and using value_1 as our control. Set value_1 to the fraction of the result that you want to be black (so 0.4 in the top Step node produces 40% black and 60% white, and 0.7 in the bottom step node produces 70% black and 30% white). Now we have our two edges, we can use another maths node to produce the strip. Our Subtract maths node subtracts the second Step node from the first, leaving us with just the area between 40% and 70% across the U variable. This example material uses the V node to produce a horizontal stripe across the bottom part of the shirt. This stripe controls the blender node, used here to mix a brown weave with a blue sky stripe. |