Houdini 20.5 Nodes Geometry nodes

Texture Mask Paint

Paints a mask into a texture map.

On this page
Since 20.0

Overview

Similar to the Attribute Paint node, this node provides an interactive painting workflow. However, the Texture Mask Paint node outputs volumetric texture data (an image) instead of geometric attribute values. This frees the mask resolution from the topology, which lets you paint a richly detailed mask on relatively coarse geometry.

The texture data is output as a 2D volume primitive, which is the same primitive type as HeightFields. You can use this primitive as an input for downstream operations, such as in the following ways:

  • Use the output with any HeightField SOP. For example, export it to disk as an image file using the HeightField Output node.

    Note

    For most HeightField SOPs, the primary incoming layer must be named height, so set the Texture Mask Paint’s Mask Name to height.

  • Use the output with any Volume SOP. For example, the Volume Wrangle or Volume VOP nodes.

  • Connect this node’s second output to the second input of an Attribute From Map node. You can use the data as regular geometry attributes and perform the same functions that you would with the Attribute Paint’s output.

For example, use this node for grooming when you want detailed control over a hair growth pattern on a geometrically simple part of a model.

It’s recommended you use the latest available driver for this node. If you encounter issues using this node, you can try upgrading your driver.

Note

Only Windows and Linux support this node.

Mac

If you create and select this node on macOS, you’ll receive a message saying this node isn’t yet supported.

Video courtesy of Andriy Bilichenko.

How to

The following is an example of how to use the Texture Mask Paint node with the Scatter in Texture Mask node.

  1. Create a Grid node in your scene and dive into the node network.

  2. Add and then connect to a UV Texture node.

  3. Add a Texture Mask Paint node.

  4. Wire the UV Texture node into the first input of the Texture Mask Paint node.

  5. Add a Scatter in Texture Mask node.

  6. Wire the Texture Mask Paint’s first output into the Scatter in Texture Mask’s first input, and its second output into the Scatter in Texture Mask’s second input.

  7. Select the Scatter in Texture Mask node and set its display flag.

  8. Set Mask to Texture Primitive. This uses the mask attribute created in the Texture Mask Paint node. The Texture Name updates with the mask attribute name.

  9. Select the Texture Mask Paint node to access the tool. The Texture Mask Paint tool menu appears in viewport.

Inputs

Geometry

When you connect geometry to this node’s first input, this is the geometry to paint the mask for. The geometry must have a UV attribute. This input is required for the node to function.

Mask Volumes

If you connect to this node’s second input, this is the geometry’s collection of volume primitives to use as the bottom layers when painting. The node automatically uses the volume primitive with a Name attribute that matches the value of this node’s Mask Name parameter.

Outputs

Geometry

The input geometry, unchanged.

Mask Volumes

The output volumes that contain all input volumes, with any modifications, and new mask volumes that this node adds.

Parameters

Group

The primitives and/or primitive group names (see group syntax) that this node affects (paints). If this is blank, the node affects all primitives.

You can change the group between brushstrokes to vary what is masked. Changing this group does not affect previous brushstrokes.

UV Attribute

The name of the point or vertex vector attribute to use for mapping the texture to the geometry.

The default value is uv.

UDIM Attribute

The name of the primitive attribute to use to indicate which primitives belong to which UDIM tiles. The attribute should be an integer, but doesn’t need to be in standard UDIM format (1001, 1002 for example).

When a UDIM attribute is given, this parameter allocates a texture for each unique value of the UDIM attribute. Primitives that share the same value for that attribute map to the corresponding texture.

All volumes have the same resolution, as specified by the Resolution parameter.

The default value is udim.

Mask Name

The name to assign to the Mask Volumes’ output volume. This parameter also determines which volume primitive the Mask Volumes’ input uses.

If you don’t want to use any of the volume primitives connected to the Mask Volumes input as a background layer, use a name that doesn’t exist on any of those volumes.

The default value is mask.

Resolution

The pixel resolution of the mask.

The default value is 1024.

Output Update

Controls how often to update the Mask Volumes' output volume. Use this parameter when you're painting while displaying a downstream node that uses this node’s output volume as an input.

Continuous (default)

Continuously updates the output volume during a brushstroke.

On Mouse Up

Updates the output volume only at the end of a brushstroke.

Clear

The value to which to clear the mask. This parameter clears the entire image, not just the paintable areas (the areas that the geometry’s UVs map it to). When set to 0 (the default value), this functions like a reset button.

This parameter lets you set the color of the spaces between the UV islands, which means setting this parameter to 0.5 has a different result than painting the entire image with a mask value of 0.5.

2D Paint Mode

Swaps the geometry for a 2D grid mapped to the full UV range to simulate painting on a 2D canvas, similar to a traditional digital painting application.

The first input geometry is unwrapped in UV space and placed on top of the grid geometry so you can visualize the UVs while painting. To clearly see the geometry, set the Visualization tool to a mode that shows the wireframe.

To enhance the simulatation of 2D painting, switch to the Front viewport camera view (hold Space and press 3 or see Viewing the scene for more details).

Brush

Brushes determine how brushstrokes affect the painting. The brush Name impacts which Brush parameters appear.

The atomic unit of a brushstroke is a splat. This is like a single stamp of the brush, which resembles a single continuous brushstroke when combined with neighboring stamps.

Note

For this node, “Alpha” refers to an image that acts as a stencil when using the Foreground Value to paint.

Name

The brush to use for painting.

Tip

Press G in the view to select a brush from the radial menu.

Paint (default)

A standard brush for building up paint.

Erase

Erases the paint by scraping off the current layer of paint, which exposes the input paint layer if one exists. This is different from using the Paint brush while the Foreground Value is set to 0, which paints the layer black.

Smooth

Averages out the paint values underneath the brush.

Smudge

Smears paint from one area of the mesh to another.

Texture

Uses an image file (see Alpha Image File) as a stencil for the brush splats. This parameter repeats a scaled down image, so it works well with tileable images.

Stamp

Uses an image file (see Alpha Image File) as a stencil for the brush splats. If the image is scaled down, the outside areas of the image’s border are black.

Dirt

Creates noise that resembles dirt as the stencil.

Cloud

Creates noise that resembles clouds as the stencil.

Operation

Applies the Foreground Value to the pixels of the current painting. Use the Opacity parameter to lessen the affect of this parameter.

Over (default)

Standard digital painting over operation that simulates the real-life application of a physical painting medium.

Add

The value is added to the existing one. Use a negative value to subtract values.

Multiply

The value is multiplied by the existing one, which can create a softer reduction in paint values.

Space

Determines how the brush projects onto the geometry.

World (default)

The brushstrokes impact the surface of the mesh as if the brush exists in the 3D scene. The brush is a circle that lies flat against the mesh’s surface and affects all pixels within its radius.

Screen

The brush remains in the camera plane as a circle and doesn’t adjust to lie flat against the mesh’s surface. The brush affects all pixels within its radius. Use this setting with the Stamp brush to increase the consistency of the brush orientation.

This setting requires a GPU driver that supports ray tracing. You’ll receive a message if your GPU driver doesn’t support ray tracing.

Radius

The size of the brush’s radius in Houdini units.

The default value is 0.1.

Foreground Value

The value the brush applies in its painting operation.

The default value is 1.

Background Value

An alternate value the brush applies. Hold Ctrl while painting to apply this value.

It can be useful when painting to switch between a light and dark value. For example, if Operation is set to Add, Foreground Value is set to 1, and Background Value is set to -1, you can apply paint with the Foreground Value and then remove paint with the Background Value.

The default value is 0.

Spacing

The space between the brush splats. Lower values decrease the amount of space between splats. Higher values increase the amount of space between splats.

This can affect the brush strength because a low value increases the number of splats in the area.

The default value is 0.5.

Opacity

The strength of transparency for each brush splat. Lower values increase the transparency. Higher values decrease the transparency.

The default value is 1, which makes the brushstroke fully opaque.

Soft Edge

The strength of transparency from the outside edges towards the center, softening the brushstroke in a gradient to blur the edges. Lower values decrease the transparency. Higher values increase the transparency.

The default value is 0.5.

Alpha Scale

The size of the Alpha Image File, Dirt noise, or Cloud noise within the brushstroke.

The default value is 1.

Alpha Rotate

The orientation of the Alpha Image File, Dirt noise, or Cloud noise within the brushstroke.

The default value is 0.

Alpha Image File

The image file that the brush uses for a Stamp or Texture. This image acts as a mask for each splat to allow for more detailed and complex painting effects.

The default value is Mandril.pic.

Advanced

Custom Brush File

A geometry file with points (brushes) to override or add to the default set of points. Brushes are internally stored as geometry, and each brush is a point with attributes that determine what settings to use and parameters to expose.

There is no official documentation for what attributes must exist on a point so it acts as a brush. View the default brush geometry to see what point attributes need to specified, which you can access by unlocking the HDA, diving inside, and inspecting the BRUSHES stash node.

Reset To Defaults

Resets the brushes to their default definitions. Removes any custom brushes added since the node’s creation.

Symmetry

Enable Mirroring

Mirrors brushstrokes across an axis, which is set by Mirror Axis.

This parameter is useful when working with symmetric meshes.

Mirror Axis

The axis of the mirror plane. The plane passes through the origin in all cases.

To effectively offset the mirror plane in some directions, translate the mesh in the opposite direction.

The default value is X.

Visualization

Show Geometry

Displays the geometry in the view. Turn this off so you can display and paint on the geometry of a downstream node that’s connected to the Mask Volumes output while this node is selected.

Visualization Type

Controls how the mask value displays the mesh.

Layered (default)

Use the mask value to composite a top layer over a bottom layer. When the top layer is solid white and the bottom layer is solid black, this is the same as visualizing the mask.

Ramp

Use the mask value to create a color ramp .

Foreground Color Mode

Specifies what represents a mask value of 1.0 (the foreground layer).

Color (default)

Use a color for the mask value.

Texture

Add an image file to use texture for the mask value.

Background Color Mode

Specifies what represents a mask value of 0.0 (the background layer).

Color (default)

Use a color for the mask value.

Texture

Add an image file to use texture for the mask value.

Snapshot

Move Stash To New File

Offloads the current painting volume to a file on disk. You can use this to reduce the .hip file size.

Load Stash from File

Loads the stash from disk into the Mask Volumes.

Volumes File

The file that stores the Mask Volumes.

See also

Geometry nodes