Remesh from Masks

by Clark Cheng


Icon Icon

Remeshing with Color Masks in Houdini

In Houdini, color masks (typically stored in the Cd attribute) can be a powerful tool for controlling localized remeshing. By assigning specific colors to regions of a mesh, you can direct the remesher to vary triangle density—refining detail where needed while keeping other areas coarse for performance.

Workflow Summary:

  1. Create or import your base geometry.
  2. Paint mask using Cd attribute: Use the Attribute Paint SOP or import a texture to define color zones (e.g., red = high detail, blue = low detail).
  3. Remesh SOP setup: In the Remesh SOP, enable Adaptivity and use a mask to drive the Target Edge Length. This is done by referencing the Cd attribute (for example, using a Point VOP or Wrangle to remap Cd to an edge length float).
  4. Control detail levels: Map red areas to smaller edge lengths for finer detail, and blue/black areas to larger lengths for broader triangles.

This approach gives you fine-grained control over where the geometry is optimized—ideal for workflows like game asset preparation, simulations, or stylized mesh effects.

Node network overview
1. Starting Houdini node setup with a basic geometry input and paint mask.

Attribute paint setup
2. Attribute Paint SOP used to define colored regions for remeshing control.

Remesh SOP network
3. Network includes logic to convert color mask into edge length attributes for adaptive remeshing.

Original high-res bunny
4. Original geometry (Stanford Bunny) before remeshing, painted with a detail mask.



          @targetmeshsize=@Cd.r;
          @targetmeshsize=fit(@targetmeshsize,0,1,chf('min'),chf('max'));
          

The code snippet sets the @targetmeshsize attribute based on the red channel value of the @Cd (color) attribute. Then, it remaps this value from the original range 0 to 1 to a new range defined by user-controlled parameters min and max via the chf() function.

In summary, this scales the mesh size attribute proportionally according to the red color component, allowing dynamic control over the mesh size range through interface parameters.


Low-poly region preview
5. Remeshed version showing a simplified low-poly region based on the mask.

This video demonstrates the full remeshing process in Houdini, guided by a custom-painted color mask. The mask acts as a spatial controller, allowing denser triangulation in high-detail areas and coarser geometry where less precision is needed. This targeted approach is particularly useful in workflows that balance visual fidelity and performance—such as game assets, simulations, or stylized effects. By converting the color data into adaptive edge length values, Houdini intelligently redistributes geometry, resulting in a cleaner, more efficient mesh that aligns with both artistic intent and technical constraints.