Page Contents


Overview


The Stochastic Flakes material can be used to simulate car paints, snow, and other glittery materials. It works by simulating at render time the aggregated effect of a large number of mirror-like flakes scattered over the surface of an object. The material is somewhat similar to the Car Paint Material, but uses less memory and avoids the tiling issues for these materials. The term stochastic means "using a random variable".

 

 

 

Base Parameters


 

 

 

Color – Specifies the reflection color of the flakes. 

Highlight Glossiness  Controls the distribution of the flakes. Values close to 1.0 will orient all flakes with normals pointing more perpendicular to the surface, whereas lower values will randomize the normals of the flakes. For more information, please see the Highlight Glossiness example below.

BRDF Type – Specifies the BRDF used to guide the distribution of the flakes:

Beckmann – Uses a Beckmann distribution for the flakes. 
GGX
 – Uses GGX distribution for the flakes (the GGX distribution has a longer "tail" compared to Beckmann).

Flakes – When enabled, the material simulates flakes scattered on the surface of the object. If disabled, the material simply renders the specified BRDF type with the specified glossiness. For more details, please see the Enable Flakes example below.

Mapping Type – Specifies the way the flakes are scattered on the surface:

Mapping Channel – The flakes are mapped according to the specified mapping channel. The density of the flakes on the surface depends on the way the UVs follow the surface. 
Triplanar 
 – The material will use triplanar mapping to create the flakes. This mode is useful for objects that don't have suitable UV mapping.

Count – The number of flakes, expressed as the square root of the actual number of flakes in the unit texture square. For example, a value of 3000 generates 9,000,000 flakes in the unit texture square. The number of flakes is restricted to 231 (a little over 2 billion), which means the highest useful value for Num Flakes is 46340. If you need more than 2 billion flakes, increase the Flake Scale parameter. For more details, please see the Number of Flakes example below.

Scale – Controls the scale of the flakes in texture space. When Mapping Type is set to Mapping Channel, a value of 1.0 is recommended. For Triplanar from Object XYZ mapping, the Num Flakes amount is distributed in each square unit in local object coordinates. In this case it is necessary to lower the Flake Scale value to 0.05, 0.01, or even less, and increase the Num Flakes value depending on the object size, especially if square artifacts are observed.

Angle – Controls the "softening" of the flakes effect. Higher values produce softer results while smaller values make the flakes sharper. Usually, value between 0.5 and 0.8 are used. For more information, please see the Blur Angle example below.

 

 


Example: Enable Flakes

 

 

Enable Flakes is disabled. The continuous GGX distribution is rendered.


Enable Flakes is enabled

 

 

 


Example: Number of Flakes

 

 

Num Flakes = 2236 (5,000,000 flakes per unit texture square)

 

Num Flakes = 7070 (50,000,000 flakes)

 

Num Flakes = 22360 (500,000,000 flakes)

 

 

 


Example: Highlight Glossiness

 

 

Hilight Glossiness = 0.6

 

Hilight Glossiness = 0.8

 

Hilight Glossiness = 0.95

 

 

 


Example: Blur Angle

 

 

Blur Angle = 1.0

 


Blur Angle
= 3.0

 

Blur Angle = 6.0

 

 

 


 

 

Colored Flakes 


The Colored Flakes parameters control the color and random hue and lightness of the flakes. The correct physical behavior is that the material appears darker, since the colored flakes/mirrors reflect only certain part of the spectrum. When viewed from distance, the aggregate color of the material converges to the average color of the flakes.


 

 

Colored Flakes – Dropdown to enable Colored Flakes.

Mode – Specifies the randomization method of the colored flakes. 

Random Hue – Enables randomized hue for the flakes. 
Random from Map
 – Enables use of a texture map for randomized colors.

Saturation – Determines the saturation variation of the colors for all flakes.

Lightness – Controls the lightness variation of the colors for all flakes.

Random Color Map – Available when Colored Flakes is set to Random from Map. Specifies a texture from which random colors are sampled and applied to the flake color. Note that only the bottom-most horizontal row of pixels from the texture will be sampled; all other parts are ignored. For more information, see the Random Color Map example below.

White Average – When enabled, renders colored flakes without the darkening effect. Note that this is not physically correct.

 


 

Example: Random Color Map

 

The Random Color Map parameter allows the user to provide a texture map for randomizing the stochastic flake colors. It is only accessible when Colored Flakes is set to Random from Map. Random colors are generated by sampling the horizontal row of pixels at the very bottom of the map along the U-axis. The sample area is only 1 pixel tall; the rest of the map is ignored.

 

 

 

 

 

Advanced Options



 

 

Seed – The seed for the randomization of flakes. Changing this value produces different flake patterns.

Blend Min – Specifies the number of flakes per pixel below which the flakes are computed. When the number of flakes per pixel is above this value, the material gradually transitions into a smooth (non-discrete) BRDF.

Blend Max – Specifies the number of flakes per pixel above which the material will only compute the smooth (non-discrete) BRDF. If the number of flakes per pixel is below this value, the material gradually transitions into discrete flakes.

 


Multipliers



 

 

Mode – Specifies how textures and colors are blended by the multipliers. 

Multiply – When set to Multiply, the texture is blended with black color. 
Blend Amount – When Blend Amount is selected, the user-specified color is used for blending.

Color – Blends between the assigned texture and the mode specific color. 

Hilight Glossiness – Blends between the assigned texture and the mode specific color. 

 

Material Options


 

 

 

Can be Overridden – When disabled, the material will not be overridden by the Material Override option in the Render Settings.

Alpha contribution – Determines the appearance of the object in the alpha channel of the rendered image.

Normal (1) – A value of 1.0 means the alpha channel will be derived from the transparency of the material.
Ignore in Alpha (0)   A value of 0.0 means the object will not appear in the alpha channel at all. 
Black Alpha (-1) – A value of -1.0 means that the transparency of the material will cut out from the alpha of the objects behind. 

ID Color – Allows you to specify a color to represent this material in the Material ID VFB render element. 

Cast Shadows – When disabled, all objects with this material applied will not cast shadows.

Only in Secondary – When enabled, objects with this material applied will only appear in reflections and refractions and will not be directly visible to the camera.

 

 

Maps


These determine the various texture maps used by the material.

Bump/Normal Mapping

 

 

Bump/ Normal Mapping – Enables or disables the bump or normal effect.

Mode/Map – Specifies the map type. 

Bump Map
Local Space Bump 
Normal map 

Amount – A multiplier for the bump/normal map.

Advanced Options

 

Normal Map Type – Specifies the normal map type. 

Tangent space
Object space
Screen space
World space 

Delta Scale – Decrease the value of the parameter to sharpen the bump, increase it for more blurry effect of the bump. 

 

Displacement




Displacement – Enables or disables the displacement effect.

Mode/ Map – Specifies the mode in which the displacement will be rendered. 

2D Displacement – Bases the displacement on a texture map that is known in advanced. The displaced surface is rendered as a warped height-field based on that texture map. The actual raytracing of the displaced surface is done in texture space and the result is mapped back into 3D space. The advantage of this method is that it preserves all details in the displacement map. However, it requires the object to have valid texture coordinates. You cannot use this method for 3d procedural textures or other textures that use object or world coordinates. The parameter can take any values. 
Normal Displacement – Takes the original surface geometry and subdivides its triangles into smaller sub-triangles, which then are displaced. 

Amount – The amount of displacement. A value of 0.0 means the object appears unchanged. Higher values produce a greater displacement effect. This parameter can also take a negative value, in which case the displacement will push geometry inside the object. 

Shift – Specifies a constant, which will be added to the displacement map values, effectively shifting the displaced surface up and down along the normals. This can be either positive or negative.

Keep continuity – When enabled, tries to produce a connected surface, without splits, when there are faces from different smoothing groups and/or material IDs. Note that using material IDs is not a very good way to combine displacement maps since V-Ray cannot always guarantee the surface continuity. Use other methods (vertex colors, masks etc) to blend different displacement maps.

View dependent – When enabled, Edge length determines the maximum length of a subtriangle edge in pixels. A value of 1.0 means that the longest edge of each subtriangle will be about one pixel long when projected on the screen. When disabled, Edge length is the maximum sub-triangle edge length in world units.

Edge length – Determines the quality of the displacement. Each triangle of the original mesh is subdivided into a number of subtriangles. More subtriangles mean more detail in the displacement, slower rendering times and more RAM usage. Less subtriangles mean less detail, faster rendering and less RAM. The meaning of Edge length depends on the View dependent parameter. 

Max subdivs – Controls the maximum sub-triangles generated from any triangle of the original mesh when the displacement type is Subdivision. The value is in fact the square root of the maximum number of subtriangles. For example, a value of 256 means that at most 256 x 256 = 65536 subtriangles will be generated for any given original triangle. It is not a good idea to keep this value very high. If you need to use higher values, it will be better to tessellate the original mesh itself into smaller triangles instead. The actual subdivisions for a triangle are rounded up to the nearest power of two (this makes it easier to avoid gaps because of different tessellation on neighboring triangles). 

Water Level – Clips the surface geometry in places where the displacement map value is below the specified threshold. This can be used for clip mapping a displacement map value below which geometry will be clipped. 

Level Height – Value below which the geometry is clipped. 

 

 

Environment Overrides


Allows Background, Reflection, and Refraction maps from Environment Settings to be overridden for the current material.

 

 

 

Background Environment

Texture – Specifies a texture to be used as the overriding map.

Multiplier – Specifies a multiplier for the overriding map.

Reflection Environment

Texture – Specifies a texture to be used as the overriding map.

Multiplier – Specifies a multiplier for the overriding map.

Refraction Environment

Texture – Specifies a texture to be used as the overriding map.

Multiplier – Specifies a multiplier for the overriding map.

 

References


The VRayStochasticFlakesMtl material is based on the Chaos Group paper "A Practical Stochastic Algorithm for Rendering Mirror-Like Flakes" (PDF Download).