The Corona Pattern Modifier (CoronaPatternMod) can be used to cover a base object with a 3D pattern generated by repeating another object over the base object's surface.
Before continuing reading about the Corona Pattern Modifier, you can download an archive with example pattern geometry here. Feel free to experiment with it!
You are currently viewing the Corona Pattern article in the Chaos Help Center, which explains the usage of the feature and provides useful examples. You can also check Corona Pattern Modifier at the Chaos Documentation Portal.
Table of Contents
- How to use the Corona Pattern Modifier?
- Mixing the UVW mapping of the pattern and the base object
- Corona Pattern and Cosmos
- Other Resources
- Troubleshooting
- Examples
How to use the Corona Pattern Modifier?
Please note that Corona Pattern cannot be converted into an editable mesh since it's a render-time effect only! It also means that you cannot preview it in the viewport.
Assign the modifier to the base object (the object which we want to cover with the pattern):
Pick the Pattern node (the pattern will be created by repeating this object):
A crop-box and UVW axes will appear around the Pattern node. It is worth checking the Pattern node's XForm, rotation, and scale, to make sure it will be distributed on the base object as expected.
The resulting pattern is tightly connected to the UVWMapping and texture coordinates of the base object.
Example
Relation of Corona Pattern to UVW Mapping
Let's create a teapot and give it a material with a radial gradient in its Base color slot, for the best visual explanation on how CoronaPatternMod and UVWMapping relate to each other:
To make everything visually more understandable in the viewport, let's apply a UVWXform modifier and increase the texture tiling for the teapot. Note that the object's UVW texture coordinates are modified, not the gradient map's ones:
Now each dot represents 1 texture space for the teapot. That means if CoronaPatternMod is applied, one Pattern node will be placed on top of each of the dots.
Let's apply the CoronaPatternMod to the teapot and pick the blue sphere as the Pattern node:
Note the Crop Box and UVW axes appearing around the sphere.
This is how the render currently looks:
Note: The CoronaPatternMod modifier is applied only during rendertime. You will not see its effect in the viewport.
You can further change the tiling parameters in the CoronaPatternMod settings:
Now when we know the basics, let's dive deeper.
Pattern height controls the local Z axis scale for the Pattern node. Changing it to 0.2, will result in spheres on teapot being 5 times shorter:
Note that even if you scale the Pattern node in Z axis, no changes will happen, as the original XForm of the Pattern node is considered:
"Fit in world space" option can be used in such case to virtually reset the XForm of the Pattern node for CoronaPatternMod modifier. By default "Fit in object space" is used when CoronaPatternMod is applied.
Note how the spheres are "higher" again and that Crop Box size in the Z axis has changed to fit the scaled sphere.
In general, Pattern height parameter is the more convenient way of controlling the pattern node's Z scale.
Pattern Offset
The Pattern offset parameter offsets the Pattern relative to the base surface, along its normals direction. To understand visually better, let's create a plane and a torus, apply the torus as the pattern node to the plane, and change the UV tiling to 10:
We can as well enable Render base object to see the offset effect better:
Render base object: Enabled
As we can see, with the default value of 1.0 for Pattern offset, the torus is placed on the plane with its crop box's bottom aligned to the plane. A value of 0 will place the torus midway the plane, with the Crop Box centered to plane vertically:
Pattern offset: 0.0
A value of -1.0 will place the torus below the plane:
Pattern offset: -1.0
Material and IDs
If we apply a material to the pattern node, Use pattern material option can be enabled for having the patterned geometry use the torus material:
Restrict on material ID option can be used to create pattern only on polygons with selected ID
As for the ID and UVW modes, first, let's modify the IDs on torus to make it sliced in 4 colors. Then apply a CoronaMultiMap with 4 different slots to torus material Base color, with Face Material ID option enabled.
With Use pattern material option enabled and "Id mode" set to Pattern object - IDs are taken from the Pattern node - we will have this result:
ID Mode: Pattern object
The patterned geometry is, same as the torus, sliced in 4 parts.
If we modify the base plane's polygon IDs and set the ID mode to Base object, the patterned geometry's color will depend on what polygon ID the pattern is formed on, taken from the Base object:
ID Mode: Base object
Note that the base object still has no material applied, but the IDs and colors are taken from it. If we disable the CoronaPatternMod modifier and apply the same material to the base plane, this is how it will look:
Same material applied to the Base object
So, even if there is no material applied to the base object, the IDs are taken from it as if there was a material applied. Enabling the modifier back this is how it will look - note that both the pattern node and the base object have the same material applied:
ID mode: Base object
Changing the ID mode to Pattern object we will see that the base plane is rendered as before but the patterned geometry is like the pattern node - the torus:
ID mode: Pattern object
The same principle is used for the UVW mode when there are maps applied.
Randomization may be achieved using Random offset and Random rotation parameters, which can also be stepped:
Random offset U from 0.0 to 1.0, Step: 0.0
Note that the Pattern geometry can easily get trimmed:
Random offset U from 0.0 to 1.0, Step: 0.5
No Random rotation - all toruses are colored exactly the same way.
Random rotation from 0.0 to 360°, Step: 90° - each torus is randomly rotated by 90 degrees or a multiplier of it. This results in randomized color distribution.
Mixing the UVW mapping of the pattern and the base object
In Corona 12 and newer you can use the UVW mapping of the pattern object and the base object at the same time. This lets you achieve some effects which were previously impossible:
- Mixing the textures applied to the whole base object with the textures of the pattern object - e.g. a carpet which has a geometric pattern as its diffuse color but also each clump of textile strands has its own diffuse texture with varying colors, or an opacity map.
- Controlling the color of a blanket using a diffuse texture mapped on the pattern object but at the same time using a bump map mapped to the whole base object to apply wrinkles on the surface.
Here is a short tutorial explaining how to use this feature:
For the purpose of this tutorial, we will be using two objects:
1. The pattern object - it's a custom model of a single "stitch" that is used to produce the knitting effect on the base object.
2. The base object - for simplicity, we will be using a simple plane object here.
Note: in this tutorial, all material IDs used both in the pattern object and in the base object are set to 1!
The material IDs of all the faces creating the pattern object are set to 1. The base object also has its material ID set to 1.
The pattern object is mapped in a way that a simple directional texture creates the effect of slight color variance in the threads making up the "stitch":
The base object is mapped in a way that the texture spans across its surface:
Our end goal is to use both mapping types at once - we would like the large-scale texture to appear on the base object surface, but at the same time we would like each "stitch" to have slight color variance thanks to its own texture detail.
As the first step, let's apply the Corona Pattern Modifier to the base object:
At this point, we can see that that the pattern is distributed over the base object and that only the pattern's texture and mapping is considered. This is because we are using the "use pattern material" option and the UV mode is set to "Pattern object".
Let's see what happens if we change the UV mode to "Alternate both":
The result is that the texture does not appear on the pattern any more, but that is expected.
To fix that, let's try changing the map channel of the texture we are using to color the pattern object from the default value of 1:
Map channel 2:
With the map channel set to 2, we can now see that the texture is mapped based on the pattern object's UVW mapping again.
Map channel 3:
With the map channel set to 3, we can now see that the texture is mapped based on the base object's UVW mapping. This is a good sign! Now we know that the map channel 2 corresponds to the pattern object's mapping and the map channel 3 corresponds to the base object's mapping.
To understand it better, we can check the tooltip of the "Alternate both" option:
According to the tooltip, setting the map channel to 2 corresponds to "pattern mapping 1" and setting the map channel to 3 corresponds to "base object mapping 1" - this is exactly what we are observing and exactly what we need.
With this knowledge, we can proceed with setting up our final material. As a reminder, we would like to mix the small-scale texture of the pattern object with the large-scale texture applied to the base object. Here is one way to do it:
The small-scale texture using map channel 2 (pattern object mapping) is mixed using a Corona Mix map with the large-scale texture using map channel 3 (base object mapping). Here is what the material looks like when applied to our pattern object (since we are using the "use pattern material" option):
As you can see, this is exactly what we wanted to achieve - the large-scale texture is mapped on the base object while each individual pattern "stitch" has its own detail texture.
Texture 1 |
Texture 2 |
Texture 1 and 2 combined |
Here is another example of virtually the same material setup, where the diffuse texture is mapped on the base object while the bump texture is mapped on the pattern object:
Tip: you can use the Corona Mapping Randomizer to add variation to the textures applied to your pattern segments thus reducing the "cloned" look.
Corona Pattern and Cosmos
A wide variety of ready-to-use Pattern objects are available right in the Cosmos Browser.
To use any of these, open the Cosmos Browser from the host app and navigate to the 3D Models > Enmesh - Pattern section.
Other Resources
Check out the CoronaPattern playground thread on the forum for more!
You can check also Displacement, Scatter, and Pattern usage differences.
Troubleshooting
There are visible holes/tearing in my pattern!
This solution applies in case you are getting tearing artifacts in your pattern object:
This issue is caused by having different polygon smoothing groups in the base object:
To fix it, make sure that your base object uses a single smoothing group. You can use the "Smooth" modifier for this, or manually adjust the smoothing groups in the editable poly (set the value to 180 degrees and click "Auto Smooth"):
After applying a single smoothing group to the entire object, no artifacts are showing up:
Examples