Creating a rusted metal effect

This recipe combines a noise texture with the reflection effect covered in Chapter 5, Using Textures to create a simple rusted metal effect.

This technique is very similar to the previous recipe, Creating a paint-spatter effect.  We'll use our noise texture to modulate the reflection from the teapot. If the noise is above a certain threshold, we'll use the rust color, otherwise, we'll use the reflected color.

Get OpenGL 4 Shading Language Cookbook - Third Edition 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.