Houdini 20.5 Nodes Geometry nodes

UV Layout 3.0 geometry node

Packs UV islands efficiently into a limited area.

On this page
Since 17.0

Overview

UV Layout tightly packs UV islands into texture tiles. UV Layout can tightly pack any set of 2D profiles (islands) into any other set of 2D profiles (targets), without any restrictions on the number or size of islands or targets or the attributes that describe them. Islands can be assigned to specific targets or left un-assigned so that UV Layout can choose a target for them that allows a tightest packing.

This node can pack into different categories of targets: a single UV unit (0,0 to 1,1), one or more rectangles with arbitrary size and positions, or UDIM tiles,

UDIM tiles

UDIM is a convention for labeling unit squares in the UV texture space grid. It makes it easier to refer to specific squares, and to match up texture files to specific grid squares by putting the UDIM number in the filename.

The typical Udim grid has unit square cells, is 10 cells wide, and its lower-left cell has number 1001. (You can customize all of these conventions using parameters on this node if necessary.)

Interactive state

With the node selected, you can press Enter in the viewer to get the node’s handles state. In the node’s state, you can interactively apply overrides to islands in the viewer.

Select an island in the viewer, and then use the Override menu in the top to choose whether to override the island’s target, scale, or orthogonal offset. Set the override value using the text box/slider next to the menu, then click Apply.

General packing

Technically you can use any vector3-type point or vertex attribute to describe islands or targets, and choose a projection (XY, YZ, or ZX) to pack onto. (The projection is always “XY” for texture attributes, with X and Y corresponding to U and V in UVW space.)

You can define targets the same way you define islands, but based on the geometry in the second input. In other words, the targets will be profiles of the pieces of the geometry in a 2D projection of a coordinate attribute where the pieces are defined by connectivity and manipulated by separator edges or islands attributes if needed.

Parameters

Islands To Pack

UV Attribute

The name of the attribute to use for the texutre coordinates. Usually this is uv. If you're layering multiple UVs on the same geometry, you can enter a custom attribute name.

(If you're using this node to do general layout in 3D, you could use P to project the model’s point positions down onto the packing plane.)

Group

If this is blank, the node works on all incoming geometry. You can enter the name of a primitive group, or specify primitives using group syntax to operate on only a subset of primitives.

Scale Island to Match Their Surface Areas

Re-scales islands to their relative areas measured using the UV attribute match their 3D surface area measured using P. This means large 3D surfaces will get large UV islands, and small 3D surfaces will get small islands.

(The overrides above are applied after this rescaling.)

Axis Alignment

How/whether to align islands before packing.

None

Use the islands as they come with no pre-rotation.

By Island Symmetry (default)

Pre-rotate islands based on their shape to turn their “longest side” horizontal. This option tries to detect symmetries in the islands and respect them.

By Island Position in 3D

Pre-rotate islands so that the resulting horizontal and vertex UV lines on the surface best align with 3D coordinate axes.

For flat islands parallel to one of the coordinate planes, this should rotate the island for the UV axes to match those of the coordinate plane to which the island is parallel. For curved islands, this option considers the ideal alignment for each polygon of the island and picks one that best agrees with all polygons in the island.

Packing

Scale

Controls how the node scales the islands for packing.

Largest packable

Make islands as large as possible while still fitting them into the given targets.

Fixed

Specific a fixed scaling factor to apply to all islands.

If you choose “Fixed”, islands that fail to pack are lined up outside of the bounding box of the packing targets. You can get a primitive group consisting of the polygons of these “non-packed” islands in Output Groups and Attributes (see below).

When Pack into is “UDIM Tiles”, if you use a fixed scale, the node will fill as many tiles as can fit the scaled islands.

Island Rotation Step

The node can try different island rotations to get better packing (some islands may be able to fit into a smaller available space if they are rotated slightly). Setting this parameter is a tradeoff between allowing rotations reducing axis alignment, trying more rotations giving more efficient packing, and trying lots of rotations being slow.

No rotation

Packs islands using the rotation they get from the Axis alignment parameter.

Rotation step

Tries rotating the island by this number of degrees around a full circle. For example, 180 tries the island two ways (right-side-up and upside-down). 90 tries the island four ways (right-side-up, rotated left, rotated right, and upside-down), and so on. Each choice halves the degrees and so doubles the number of rotations that must tried.

Custom

Lets you enter a custom number of divisions of 360 degrees.

Bear in mind that 6 divisions of the circle may result in a packing inferior to 4 (90 degree steps) because only two of the attempted rotations are common and therefore one can not always expect the a tighter packing with 6 rotations compared to 4.

Avoid Packing Over Non-Group Island

This controls what to do when you use the Group field to apply this node to only a subset of the polygons in the input. When this is on, the node attempts to pack the polygons selected by the Group field around the other polygons in the input. When this if off (the default), the node will ignore the other polygons, possibly giving overlaps in UV space.

Pack Island in Cavities of Other Islands

When this is on (the default), the node will attempt to pack islands inside “holes” and concave areas in other islands. Turning this off is faster but gives less efficient packing.

Island Padding

The amount of padding to use to separates islands.

This number is in “pixels” of the Search resolution (under Advanced), so changing that number will change the padding distance in UV space.

Apply Padding Between Island Target Boundary

When this is on, padding is added between islands and the edges of the target space. When this is off (the default), islands are packed right up to the edges of the target space.

Spread Island To All Available Space

Attempts to automatically increase padding so islands spread to cover the target area.

(Normally the packing algorithm bunches up islands in tight corners as it progresses in order to leave as much space as possible for packing of subsequent islands. When this is on, once the packing is achieved, the padding is gradually increased to the maximum possible amount that still allows the same packing coverage. The effect of this is usually to spread the islands around in the available space. Note that this does not guarantee a uniform spreading as the fragmentation of the available space by the packing process can restrict free movement of the islands in some cases.)

Targets

Pack into

Controls how the

Rectangles

Lets you specify one or more square or rectangular areas in the UV plane to pack into.

UDIM Tiles

Lets you specify tiles on the UV plane by their UDIM number.

Islands from second input

Packs into areas defined by “islands” in the geometry connected to this node’s second input.

Default Target

If you leave this off, islands will be distributed to targets based on where they fit best. If you turn this on, islands will be packed into this target unless an overridden.

This is particularly useful when UDIM packing.

Target rectangles

This section is visible when Pack into is set to “Rectangles”.

Target rectangles

When Pack into is set to “Rectangles”, this multiparm lets you add or remove rectangles. You can specify the position and size of the target area on the UV grid. The default is a single UV unit square from 0,0 to 1,1.

Tile grid

This section is visible when Pack into is set to “UDIM”.

You can use Starting UDIM if you need to pack around existing data.

You should not change tile size or number of columns unless you have a good reason. Originally these were flexible (the number of columns was the U DIMension from which the convention gets its name) but they are considered standards and many software packages are hard-coded to use 1×1 tiles with 10 columns.

Tile size

The size of UDIM tiles in UV space. Do not change this value unless you have a good reason (for example, compatibility with old textures).

Columns

The number of columns in which to layout the tile grid. This has been standardized at 10 and is often hard-coded in other software packages. Do not change this value unless you have a very good reason.

Starting UDIM

The first tile to start packing into. You can use this pack around existing data lower-numbered tiles.

Second input

These parameters are visible when Pack into is set to “Islands from second input”.

UV Attribute

Similar to UV Attribute for island specification. This is a point or vertex attribute on the second input.

Group

If this is blank, the node works on all incoming geometry from the second input. You can enter the name of a primitive group, or specify primitives using group syntax to operate on only a subset of primitives.

Island Stacking

The controls in this section can detect islands that look the same and stack them over each other, which often saves texture space.

Note

Island stacking only works on connected islands. You cannot stack islands created by the Island Attribute.

Stack identical islands

Detect and stack identical islands over each other.

Match Mirrored Islands

When Stack identical islands is on, also detect islands that would be identical if reflected, mirror one and stanck them over each other.

Allow Stacking on Non-Group islands

When Stack identical islands is on, also look at islands that are not selected in the Group field, and if one matches a selected island, stack the selected island on the non-selected island.

This is useful if you have prototype island shapes already in place and want to put islands with similar shapes over them.

Shape tolerance

When Stack identical islands is on, how close the shapes need to be for them to be stacked. You can tweak this number until the islands you want to stack start stacking.

Output Groups and Attributes

Nonpacked polygons

Output a group containing the polygons of any islands that failed to pack because Fixed scaling made them too big.

Island number

Add a primitive attribute to each polygon containing the number of the island it was a part of.

Assigned target

Add a primitive attribute to each polygon containing the number of the target it was packed into.

See also

Geometry nodes