Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This article explains the settings and values for of the Corona Mapping Randomizer shader in Cinema 4D.

...

Section
Column
width50%

Textured objects often show obvious repetitions, which instantly give gives away that the scene is computer-generated. You can use the Corona Mapping Randomizer shader to quickly randomize textures on multiple objects or object parts, making the image appear more realistic.

The Corona Mapping Randomizer shader allows you to apply random offset, rotation, and scaling to texture maps and shaders assigned to different objects, or even to a single object. The way it works is one or multiple objects. It works 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 randomization, plug any texture (be it a texture map or a shader) into the Corona Mapping 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 Mapping Randomizer shader with any material property, including the bump channel, RGB normal maps, and displacement.

Column
width5%


Column
width45%

...

Section
Column
width50%

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 Color parameter.

Mix value – Defines the percentage of the texture 's percentage that is mixed with the color Color parameter. It works like opacity for the shader's texture.

Column
width5%


Column
width45%

...

Section
Column
width50%

Randomize byThis parameter allows to select Selects between different randomization modes.

PrimitivesThis mode randomizes 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 nameThis mode randomizes Randomizes the texture map or shader by different assigned materials. Materials The materials must have different names.
ObjectsThis mode randomizes Randomizes the texture map or shader per each object. You can even use this mode with cloner Cloner objects.
Material tag indexThis mode randomizes Randomizes the texture map or shader based on the object's material tag position. Polygon selection tags should can be used in combination with this mode for each material tag assigned.
Material IDThis mode randomizes the Randomizes the texture map or shader based on the Material's ID. The material Material ID can be located and set in the Advanced properties for each material.
Object buffer IDThis mode randomizes 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 of 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.
PolygonThis mode randomizes Randomizes the texture map or shader by different polygons, which are groups of triangles (e.g. quads).
DecalThis mode randomizes 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.
Tile IDThis mode randomizes Randomized by different tiles if Corona Tile Map is used.
Multiple propertiesThis mode allows Allows using different randomization modes at the same time.

UI Text Box
typeinfo

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 FromThis parameter sets Sets the initial position of the shader texture in the U coordinate for the shader's texture.

U ToThis parameter sets Sets the maximum end position that of the shader 's texture can use for in the U coordinate. The shader can randomly use any value between the U From and U To parameters.

U StepThis parameter lets you decide Determines the offset 's increment for each texture variation in the U coordinate for each texture variation. It works like the Quantize Move Step tool in Cinema 4D.

V FromThis parameter sets Sets the initial position of the shader texture in the V coordinate for the shader's texture.

V ToThis parameter sets Sets the maximum end position that of the shader 's texture can use for in the V coordinate. The shader can randomly use any value between the V From and V To parameters.

V StepThis parameter lets you decide Determines the offset 's increment for each texture variation in the V coordinate for each texture variation. It works like the Quantize Move Step tool in Cinema 4D.


Rotation

W FromThis parameter sets Sets the initial rotation of the shader texture in the W coordinate for the shader's texture..

W ToThis parameter sets Sets the maximum end rotation that of the shader 's texture can use for in the W coordinate. The shader can randomly use any value between the W From and W To parameters.

W StepThis parameter lets you decide Determines the offset 's increment for each texture variation 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 of the shader texture in the U coordinate for the shader's texture.

U To – Sets the maximum end scale that of the shader 's texture can use for in 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 –Determines the offset 's increment for each texture variation 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 of the shader texture in the U coordinate for the shader's texture.

V To – Sets the maximum end scale that of the shader 's texture can use for in the V coordinate. The shader can randomly use any value between the V From and V To parameters.

V StepThis parameter lets you decide Determines the offset 's increment for each texture variation 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)the V and U axis use the same values for scale, rotation and offset. If this checkbox is not active, it allows you to set different scale values for each axisaxes.

Column
width5%


Column
width45%

...

Section
Column
width50%

Randomize each tile This parameter When enabled, tiles the texture on each surface it is applied to, and is randomized using the offset Offset, rotation Rotation, and scale 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 values blend the tiles further together and makes make the texture appear slightly more blurry and uniform. Lower blending values reduces reduce the areas where the tiles are blended together and makes make the texture sharper.

Column
width5%

Column
width45%

...

Section
Column
width48%

Primitives

The mapping Mapping is randomized per each mesh primitive (triangle)

Column
width4%


Column
width48%

Objects

Mapping is randomized per each instance (object).

Section
Column
width48%

UI Expand
titleClick here to the material setup

Click on the image to view it in full size

Column
width4%


Column
width48%

UI Expand
titleClick here to the material setup

Click on the image to view it in full size


...


Section
Column
width48%

Material ID

Mapping is randomized based on the object's material ID. In this example, every tile has a different, randomly assigned material ID (material Id . Material ID must be manually assigned for each material in their respective Advanced properties section).

Column
width4%


Column
width48%

Object buffer ID

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).

Section
Column
width48%

UI Expand
titleClick here to the material setup

Click on the image to view it in full size

Column
width4%


Column
width48%

UI Expand
titleClick here to the material setup

Click on the image to view it in full size


...


Section
Column
width48%

Mesh Element

Mapping is randomized per each mesh element. In this example, each tile is a separate mesh element (geometry has been split).

Column
width4%


Column
width48%

Polygon

Mapping is randomized per mesh face. In this example, each tile is a single polygon.

Section
Column
width48%

UI Expand
titleClick here to the material setup

Click on the image to view it in full size

Column
width4%


Column
width48%

UI Expand
titleClick here to the material setup

...

Click on the image to view it in full size


...


Section
Column
width48%26


Column
width48

Tile ID

Mapping Randomizer is randomized based on the Tile ID. In this example, each Tile has the same wood texture.

Column
width26


Section
Column
width26


Column
width48

Image Added

UI Expand
titleClick here to see the material setup...

Image Added

Click on the image to view it in full size




...


Example: Texturing a Simple Stairs Object


Section
Column
width48%

Without the Mapping Randomizer Without the Mapping Randomizer shader, the textures are repeated on each of the steps in a very obvious way.

Column
width4%


Column
width48%

We can easily fix that: the The first step to fixing this is plugging the diffuse texture into the Corona Mapping Randomizer Mapping 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.

Section
Column
width48%

Column
width4%


Image Removed

Column
width48%48%

Image Added

Image Removed

UI Expand
titleClick here to the material setup



...


Section
Column
width26%


Column
width48%

The remaining issue is that the textures are aligned in the wrong direction. Since the Mapping Randomizer , since the Mapping Randomizer shader relies on UVW mapping (, as the name implies), to . 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.

Column
width26%


Section
Column
width26%


Column
width48%

Column
width26%


UI Expand
titleClick here to the material setup

Image Added

Click on the image to view it in full size


...


Example: Randomizing a Brick Wall

...

Section
Column
width48%

We can start with a few objects using with a brick wall texture with no without any randomization whatsoever.

Column
width4%


Column
width48%

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 Mapping RandomizerMapping Randomizer.

Section
Column
width48%

Image RemovedImage Added

Column
width4%


Column
width48%

Image Added

UI Expand
titleClick to see material setup

Image Added

Image Removed


...


Section
Column
width26%20%


Column
width48%60%

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 Offset, rotation Rotation, and scale Scale values. 


The remaining issue here is that while the randomization works excellentwell, 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.

Column
width26%20%


Section
Column
width26%20%


Column
width48%60%

Image Added

UI Expand
titleClick to see material setup

Image Added

Image Removed

Column
width26%20%



...


Section
Column
width26%20%


Column
width48%60%

As you can see in the above image, the bricks are still randomized, but at the same time they are always now 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 to add displacement to the brick material. That is also possible with the Mapping Randomizer Mapping Randomizer shader. Clone the Mapping Randomizer Mapping 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.

Column
width26%20%


Section
Column
width26%20%


Column
width48%60%

Image Added

UI Expand
titleClick to see material setup

Image Added

Image Removed

Column
width26%20%



...


Example: Using the Mapping Randomizer with the Multi Shader


Section
Column
width26%20%


Column
width48%60%

The Corona Mapping 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 Mapping Randomizer to randomize the wood texture per floorboard, and every floorboard also has a different color thanks to the Corona Multi Shader which , both of which are then mixed together using the Corona Mixture shader.

Column
width26%20%


Section
Column
width26%20%


Column
width48%60%

Column
width26%20%



...


Example: Using the Mapping Randomizer with Triplanar Mapping

...

Section
Column
width48%

In the previous examples, we always used the Corona Mapping Randomizer with some sort of defined UVW mapping (e.g. the object was created with its own mapping). In the case of objects with In cases where objects have 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 duck model covered with a checkerboard patterned texture map using the Corona Mapping Randomizer. Since the Mapping Randomizer relies on UVW mapping, in case of incorrect mapping (like in this case), we can see artifacts such as texture stretching and seams.

Column
width4%


Column
width48%

To fix that, we can connect the Corona Mapping Randomizer shader to a Corona Triplanar shader (not the other way around, as the Triplanar shader overrides all mapping data coming after it!) Triplanar shader and connect the result to the desired slot (, in this case the diffuse color). This lets us take advantage of the superpowers of both the Mapping Randomizer and the Triplanar shaders. Thanks to the Mapping Randomizer, the texture is randomized in terms of offsetOffset, scalingScaling, and rotationRotation, 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.over the object's surface.

UI Text Box
typewarning

It is vital that the Corona Mapping Randomizer shader is connected to the Corona Triplanar shader, and not the other way around, as the Triplanar shader overrides all mapping data coming after it!

Section
Column
width48%


Column
width4%


Column
width48%

Section
Column
width100%
UI Expand
titleClick here to the material setup

Click on the image to view it in full-size



...

Example: Randomizing Procedural Shaders


Section
Column
width26%20%


Column
width48%60%

In all previous examples, we were using texture maps. Corona Mapping Randomizer can, however, randomize procedural shaders as well, allowing for further creativity.

In this example, a procedural noise shader is stretched in one direction ("and the U / X to Scale Tiling" is set to 10) and then . The shader is randomly distributed on the object's surface using the Mapping Randomizer and the ''Randomize each tile'' enabled along with the , with the Randomize each tile option enabled. It is then connected to a Triplanar shader. This applies the texture in a similar way as when using regular UVW mapping, which makes it easier to control (however. However, in this case, we do not have to worry about it that much because we are using the Corona Triplanar shader anyway).

Column
width26%20%


Section
Column
width26%20%


Column
width48%60%

Column
width20%


Section
Column
width20%


Column
width60%
UI Expand
titleClick here to the material setup

Click on the image to view it in full-size

Column
width26%20%




...


Example: Blending


The Blending parameter found in the Corona Mapping Randomizer parameter controls how the individual tiles of the randomized texture are blended with each othertogether. Higher blending values further blends blend the tiles together and makes make the texture appear slightly more blurry and uniform. Lower blending reduces the areas where the tiles are blended together and makes values make the texture sharper. Usually, the best value has to be can determined by trial and error.


Section
Column
width26%15%


Column
width48%70%
Image slider
startIndex1
Panel
titleBlending = 0

Image Removed
Panel
titleBlending = 0.25 (default value)

Image Removed

Panel
titleBlending = 1

Image Added

Panel
titleBlending = 1

Image Added

Column
width15%


Section
Column
width15%


Column
width70%
UI Expand
titleClick here to the material setup

Click on the image to view it in full size

Column
width26%15%




...


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.


Section
Column
width26%20%


Column
width48%60%
Before after
afterLabelHQ Blending onHQ Blending on
beforeLabelHQ Blending off
Panel

Image Modified

Panel

Image Modified

Column
width20%


Section
Column
width20%


Column
width60%
UI Expand
titleClick here to see where to find the High quality blending option

Image Added

Click on the image to view it in full sizeImage Removed

Column
width26%20%




...

Example: W Rotation and Step


The Step value can be used to decide about decides the allowed interval for the random texture offsetOffset. The same can be done with rotation Rotation and scalingScaling. This example visualizes how the W Rotation Step affects texture randomization.


Section
Column
width26%15%


Column
width48%70%
Image slider
startIndex1
Panel
titleW Rotation Step = 0

Step 0 - no interval, full, unrestricted rotation randomization allowed

Image RemovedImage Added

Panel
titleW Rotation Step = 45

Step 45 - rotation randomization is restricted to 0, 45, 90, 135, 180, 225, 270, 315, 360 degrees resulting in the pattern following only horizontal, vertical, or diagonal directions

Image RemovedImage Added

Panel
titleW Rotation Step = 90

Step 90 - rotation randomization is restricted to 0, 90, 180, 270, 360 degrees resulting in the pattern following only vertical and horizontal directionsImage Removed

Image Added

Column
width15%


Section
Column
width15%


Column
width70%
UI Expand
titleClick here to see where to find the Step options

Click on the image to view it in full size

Column
width26%15%