This shader creates a procedural flake normal map that can be used for materials such as car paint.
Note that the map does not perform any filtering, so small flakes require more Camera (AA) samples to become clean.
When connected to a normal_map shader use tangent as the output space on flakes, tangent as the input space (Mode) on the normal_map shader, and disable Interpret 8/16 bit normal map as linear.
When rendering an animation using Flakes, you should enable motion blur (to avoid temporal flickering).
A tutorial that uses the Flakes shader can be found here.
A scene file can be downloaded here.
Flakes to Normal Camera
Flakes to Mix Shader (Mix Weight)
You can also connect the mask (alpha channel) of the Flakes shader to a Mix shader to drive different colors for the flakes. For example, you could make the flakes metallic and the other parts glass by mixing them together using a Mix shader.
Mix shader connected to alpha mask of Flakes shader
Another option to get the alpha mask of the flakes shader would be to connect it to a shuffle shader and set alpha (A) to all channels.
Scales the flake structure up or down. Smaller values zoom out of the map, giving a larger number of flakes.
Controls the density of flakes. There will be no flakes if it is 0. The surface is fully covered with flakes at 1.
You can use the Mix RGBA shader to mix multiple Flakes shaders together with different Density and Normal Randomize values. In the car paint example below, a second Flakes shader has been used to create brighter flakes that are visible around the highlight.
Two different Flakes shaders combined together with a Mix RGBA shader
The following attributes should be used to control 3d flakes only.
3d flakes will not render correctly if the camera is positioned inside a polymesh.
Flakes shader using Step/Depth attributes
This shader performs ray marching to compute 3d flakes. With this users can specify the step size. The number of layers is determined by depth/step.
When rendering flakes that are close to the camera, you should use a smaller Step Size so as not to miss any flakes.
Decreasing this value may increase render times dramatically.
Specifies how deep a ray goes inside of an object. This shader generates 2d flakes if depth = 0, and 3d flakes otherwise. If a ray hits an object, it cannot traverse longer than the specified depth.
0 = 2d flakes (default)
1 = 3d flakes
0 (2d flakes). Rollover images to see 1 (3d flakes).
This value is used to refract a ray used for raymarching. This would be useful to give a 'fake' transparency effect (thus avoiding having to use true transparency which can add to render times). In some situations, it is not necessary to make the surface shader transparent. An example would be a material such as Goldstone (IOR 1.53) which has 3d flakes in it but they don't really look transparent.
Blends between the smooth surface normal (0) and the random flake normal (1).
Specifies the coordinate space used for calculating the shapes of flakes.
- World: points are relative to the global origin of the scene.
- Object: points are expressed relative to the local origin (center) of the object.
- Pref (default): short for 'vertex in reference pose'. The plugin can pass these vertices to Arnold (in addition to the regular, deformed vertices) which can, in turn, be queried by the shader so that the texture 'sticks' to the reference pose and does not swim as the mesh deforms. (Pref does not work with NURBS surfaces.)
- UV: the texture coordinates.
Ensure that you have an Arnold Tag with Export reference points enabled when using Pref coordinate space.
Specify the name of the reference position user-data array. Previously, the name was hard-coded as Pref, which is still the default.
Specifies the space of the output normal vector.
Roll over images