This article explains the settings and values for the Corona UVW Randomizer shader in Cinema 4D.
Overview
Textured objects often show obvious repetitions, which instantly give away that the scene is computer-generated. You can use the Corona UVW Randomizer shader to quickly randomize textures on multiple objects or object parts, making the image appear more realistic.
The Corona UVW Randomizer shader allows you to apply random offset, rotation, and scaling to textures maps and shaders assigned to different objects, or even to a single object. The way it works is similar to the Corona Multi Shader. For example, you can randomize a wood texture applied to a set of planks so that each plank has a different look in the final render. You can also apply a blending effect to the randomized texture tiles, which makes them appear even more natural.
To enable the UVW randomization, plug any texture (be it a texture map or a shader) into the Corona UVW Randomizer shader input slot and then plug its output into any material property. You can then adjust the texture transformations and other options to the desired values. You can use the Corona UVW Randomizer shader with any material property, including the bump channel, RGB normal maps, and displacement.
Shader Properties
Level – Defines the intensity of the entire shader parameters.
Color – Sets a solid color to use as the source.
Texture – Sets either a texture map or a procedural shader to use as the source.
Mix mode – Defines how the texture map or shader combines with the color parameter.
Mix value – Defines the texture's percentage that is mixed with the color parameter. It works like opacity for the shader's texture.
UVW Randomization
Randomize by – This parameter allows to select between different randomization modes.
Primitive – This mode randomizes the texture map or shader by different primitives which are triangles, hair strands, etc.
Sub-primitive – Randomizes by different sub-primitives, which are displacement micro triangles or hair segments.
Material name – This mode randomizes the texture map or shader by different assigned materials. Materials must have different names.
Objects – This mode randomizes the texture map or shader per each object. You can even use this mode with cloner objects.
Material tag index – This mode randomizes the texture map or shader based on the object's material tag position. Polygon selection tags should be used in combination with this mode for each material tag assigned.
Material ID – This mode randomizes the texture map or shader based on the Material's ID. The material ID can be located and set in the Advanced properties for each material.
Object buffer ID – This mode randomizes the texture map or shader based on the object's buffer ID. The buffer ID can be located and set in the Corona Compositing tag for each object.
Mesh Element – This mode randomizes the texture map or shader by different connected mesh elements, which are groups of polygons connected by edges.
Polygon – This mode randomizes the texture map or shader by different polygons, which are groups of triangles (e.g. quads).
Decal – This mode randomizes the texture map or shader by different distinct decal objects. This randomizes only the decal layer, not the object it is projected onto. Note that this tracks decals by their names, so the result changes if a decal is renamed.
Multiple properties – This mode allows using different randomization modes at the same time.
The Sub-primitive, Polygon, and Multiple properties randomization modes are available starting with Chaos Corona 8.
The Decal randomization mode is available starting with Chaos Corona 9.
Seed – This value makes random permutations of the UVW randomization results.
Offset
U From – This parameter sets the initial position in the U coordinate for the shader's texture.
U To – This parameter sets the maximum end position that the shader's texture can use for the U coordinate. The shader can randomly use any value between the U From and U To parameters.
U Step – This parameter lets you decide the offset's increment in the U coordinate for each texture variation. It works like the Quantize Move Step tool in Cinema 4D.
V From – This parameter sets the initial position in the V coordinate for the shader's texture.
V To – This parameter sets the maximum end position that the shader's texture can use for the V coordinate. The shader can randomly use any value between the V From and V To parameters.
V Step – This parameter lets you decide the offset's increment in the V coordinate for each texture variation. It works like the Quantize Move Step tool in Cinema 4D.
Rotation
W From – This parameter sets the initial rotation in the W coordinate for the shader's texture.
W To – This parameter sets the maximum end rotation that the shader's texture can use for the W coordinate. The shader can randomly use any value between the W From and W To parameters.
W Step – This parameter lets you decide the offset's increment in the W coordinate for each texture variation. It works like the Quantize Rotate Step tool in Cinema 4D.
Scale
U From – Sets the initial scale in the U coordinate for the shader's texture.
U To – Sets the maximum end scale that the shader's texture can use for the U coordinate. The shader can randomly use any value between the U From and U To parameters.
U Step – This parameter lets you decide the offset's increment in the U coordinate for each texture variation. It works like the Quantize Scale Step tool in Cinema 4D.
V From – Sets the initial scale in the U coordinate for the shader's texture.
V To – Sets the maximum end scale that the shader's texture can use for the V coordinate. The shader can randomly use any value between the V From and V To parameters.
V Step – This parameter lets you decide the offset's increment in the V coordinate for each texture variation. It works like the Quantize Scale Step tool in Cinema 4D.
V scale same as U – When enabled, this lets you use a uniform scale factor for the randomization (same value for U and V coordinates). If this checkbox is not active, it allows you to set different scale values for each axis.
Tiling
Randomize each tile – This parameter tiles the texture on each surface it is applied to, and is randomized using the offset, rotation, and scale values.
High quality blending – This option is enabled by default and results in a better quality of the random tile blending at some performance cost. The specific performance impact depends on the material's complexity. In case of visible rendering slowdown, it is advised to disable this option.
Number of tiles – This parameter sets the number of tiles to be randomized when the Randomize each tile checkbox is enabled.
Blending – This parameter controls how the individual tiles of the randomized texture are blended with each other. Higher blending further blends the tiles together and makes the texture appear slightly more blurry and uniform. Lower blending values reduces the areas where the tiles are blended together and makes the texture sharper.
Example: Randomization Modes
Primitive
The UVW mapping is randomized per each mesh primitive (triangle)
Objects
UVW mapping is randomized per each instance (object).
Material ID
UVW mapping is randomized based on the object's material ID. In this example, every floorboard has a different, randomly assigned material ID (material Id must be manually assigned for each material in their respective Advanced properties section).
Object buffer ID
UVW mapping is randomized based on the object's buffer ID. In this example, each cube object has a different buffer ID assigned (a Corona Compositing tag is required to define the object's buffer ID).
Mesh Element
UVW mapping is randomized per each mesh element. In this example, each floorboard is a separate mesh element (geometry has been split).
Polygon
UVW mapping is randomized per mesh face. In this example, each floorboard is a single polygon.
Example: Texturing a Simple Stairs Object
Without the Uvw Randomizer shader, the textures are repeated on each of the steps in a very obvious way.
We can easily fix that: the first step is plugging the diffuse texture into the Corona Uvw Randomizer shader and setting its U and V offset values to 0 - 1. This enables the randomization of the texture's maximum offset in both axes by its full width and height.
The remaining issue is that the textures are aligned in the wrong direction. Since the Uvw Randomizer shader relies on UVW mapping (as the name implies), to fix that, we can use any preferred method of rotating the textures - for example, using the Rotate tool when the Texture mode is enabled in C4D.
Example: Randomizing a Brick Wall
We can start with a few objects using a brick wall texture with no randomization whatsoever.
In this case, we want to randomize the U and V positions per object, but we also want to have them tiled on every single object in a random way. This can be easily done with the Uvw Randomizer.
Note that in addition to U and V offset variation, we also enabled the Randomize each tile option and set Number of tiles to 4. This tiles the texture on each surface it is applied to, and the tiling is then randomized using the offset, rotation, and scale values.
The remaining issue here is that while the randomization works excellent, the bricks are not aligned in straight horizontal rows anymore because of the full V offset randomization.
We can fix that by enabling the Step option. The Step value decides about the interval at which the texture is moved. Leaving it at 0 results in unrestricted, random movement. Setting it to 1 means that we only allow the offset to be 1, 2, 3, and so on, resulting in no visible randomization whatsoever. Setting the value to 0.5 allows offsetting the texture by half its height, and so on. In this case, a single segment of our brick wall texture consists of 7 rows of bricks. To calculate the desired Step value, we need to divide 1 by the number of rows or columns. In case of our brick wall 1 / 7 = 0.143, so let's use this value.
As you can see in the above image, the bricks are still randomized, but at the same time they are always arranged in horizontal rows thanks to the 0.143 Step value.
The last thing left to do in our brick material would be adding displacement to it since that is also possible with the Uvw Randomizer shader. Clone the Uvw Randomizer shader, so that the diffuse texture and displacement texture randomization is the same, plug the grayscale displacement map into it, and plug the result into the material's displacement slot.
Example: Using the UVW Randomizer with the Multi Shader
The Corona Uvw Randomizer can be combined with a Corona Multi Shader to create materials that are random in terms of both their coloring (or texturing) and their UVW mapping.
In this case, we are using the UVW Randomizer to randomize the wood texture per floorboard, and every floorboard also has a different color thanks to the Corona Multi Shader which are then mixed together using the Corona Mixture shader.
Example: Using the UVW Randomizer with Triplanar Mapping
In the previous examples, we always used the Corona Uvw Randomizer with some sort of defined UVW mapping (e.g. the object was created with its own mapping). In the case of objects with no UVW mapping channel, or ones that are hard to properly unwrap (such as complex organic forms), an ideal solution is to combine the UVW Randomizer with the Corona Triplanar shader.
Here we can see a sculpture painted with a checkerboard patterned texture map using Corona Uvw Randomizer. Since the UVW Randomizer relies on UVW mapping, in case of incorrect UVW mapping (like in this case), we can see artifacts such as texture stretching and seams.
To fix that, we can connect the Corona Uvw Randomizer shader to a Corona Triplanar shader (not the other way around, as the Triplanar shader overrides all mapping data coming after it!) and connect the result to the desired slot (in this case diffuse color). This lets us take advantage of the superpowers of both the UVW Randomizer and the Triplanar shaders. Thanks to the UVW Randomizer, the texture is randomized in terms of offset, scaling, and rotation, and it is using random tiling. Thanks to the Corona Triplanar shader, there is no stretching or seams, and the texture is uniformly distributed over the object's surface.
Example: Randomizing Procedural Shaders
In all previous examples, we were using texture maps. Corona Uvw Randomizer can, however, randomize procedural shaders as well, allowing for further creativity.
In this example, a procedural noise shader is stretched in one direction ("U Tiling" set to 0) and then randomly distributed on the object's surface using the UVW Randomizer and the Triplanar shader. This applies the texture in a similar way as when using regular UVW mapping, which makes it easier to control (however, in this case, we do not have to worry about it that much because we are using the Corona Triplanar shader anyway).
Example: Blending
The Blending parameter found in the Corona Uvw Randomizer controls how the individual tiles of the randomized texture are blended with each other. Higher blending further blends the tiles together and makes the texture appear slightly more blurry and uniform. Lower blending reduces the areas where the tiles are blended together and makes the texture sharper. Usually, the best value has to be determined by trial and error.
Example: High Quality Blending
The High quality blending option is enabled by default and results in a better quality of the random tile blending at some performance cost. The specific performance impact depends on the material's complexity. In case of visible rendering slowdown, it is advised to disable this option.
Example: W Rotation and Step
The Step value can be used to decide about the allowed interval for the random texture offset. The same can be done with rotation and scaling. This example visualizes how the W Rotation Step affects texture randomization.