UV Mask Node
Access: Nodes > Geometry > UV Mask
The UV Mask creates a black and white mask as an output based on your UVs. The inside of your UVs fills with white and anything outside fills with black.
At first glance this node may not seem that useful, but the node does not include bleed at the edges so it’s very useful when combined with other pieces of software like Nuke to create edge masks and other useful images for texturing.
Unlike most nodes, the UV Mask has no input or properties. Its output is based on the UVs of your object and nothing else.
UV Mask Node Workflow Example
UV Mask for Edge Detection Texturing with Nuke
Let’s take a look at a great use for the UV Mask, edge detection of UV shells. This is a fairly advanced technique but a useful one.
In the example, you can see the UV view of the same object, textured in two ways. The first was with the paint tool in a Paint node. As you can see when the paint buffer is baked down, the white is bled over the edges.
|
|
The second image is the UV Mask. In the 3D view it looks exactly the same, but in the UVs when exported there is no bleed.
Here is an object that has had all of its maps textured. The wings are looking a bit plain though. Since the object is going to be an aged golden statue, it would be nice to get a bit of detail around the edges of the wing feathers to make it look a bit more grand.
Hand painting the edge of each piece of the wing would be a painful task and even with steady stroke enabled it would be really difficult to get a clean edge. If we could create a mask of the geometry and then erode into that mask, we could then flip it and have just the edge of all the feathers.
But if we have a mask with bleed then it’s going to be useless, we need a mask that fills all the UVs but with no bleeding so we can shrink the mask a bit and get an edge. That’s where the UV mask node comes in.
Tip: The UV Mask node is really powerful when exported and used with other pieces of image editing software.
First we need to export the UV Mask node’s data. That requires us to bake it a Paint node first as you cannot export non baked nodes. To do that you just need to right-click the node and select Edit > Bake to Paint Node.
Once that is baked, it is ready to be exported by right-clicking and selecting File > Export.
We can now take those images into
Here is a very simple
First the UV Mask is read in, then it is eroded inwards using the Dilate node in Nuke, then we minus the original from this new dilated version which cuts out the interior of the UV islands as you can see below. Then we Write it out from
|
|
Before |
After |
Now we have this mask we can import as a new Paint node in Mari.
Using a Merge node with a blend Mode of Add, we can merge it on top of a Color node of 0.5 gray to make our displacement push out at the edges.
For an extra flourish a tiled texture has also been merged in to add some more detailing to make the design seem more grand.
While there would have been ways to achieve a similar result without the UV mask, the speed and lack of bleed on the node is what sets it apart and can speed up workflows.