Randomness – Perlin noise
Some shaders benefit from the ability to use random values. Each Material has a few nodes that can help add randomness to a shader. Randomness from a Perlin noise texture can be used to generate interesting-looking materials such as marbled materials. The noise can also be used to drive bump maps, height maps, and displacement fields for some neat effects.
Getting ready
Choose a material to which you'd like to add some randomness. Open the Material in the Material Editor, and follow the steps.
How to do it...
- Insert a Noise node into your Material Editor window.
- Normalize the coordinates of the object you're adding the noise to. You can use math such as the following to do so:
- Subtract the minimum from each processed vertex ...
Get Unreal Engine 4 Scripting with C++ Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.