Creating a paint-spatter effect
Using high-frequency noise, it is easy to create the effect of random spatters of paint on the surface of an object. The following image shows an example of this:
We use the noise texture to vary the color of the object, with a sharp transition between the base color and the paint color. We'll use either the base color or paint color as the diffuse reflectivity of the shading model. If the noise value is above a certain threshold, we'll use the paint color; otherwise, we'll use the base color of the object.
Getting ready
Start with a basic setup for rendering using the Phong shading model (or whatever model you prefer). Include texture coordinates and pass them along to the fragment shader.
There are a couple of uniform variables that define the parameters of the paint spatters:
PaintColor
: The color of the paint spattersThreshold
: The minimum noise value where a spatter will appear
Create a noise texture with high-frequency noise.
Make your noise texture available...