uv nodes
10 node types in the uv category.
hotspot#
aliases: hotspot_map uv_hotspot rect_map
Fit each island of coplanar faces to the trim-sheet rectangle or band closest to its real size.
Faces of the group that share an edge and lie in one plane form an island. Walls keep v up and u level; floors and ceilings run u along their longest edge. Each island is fitted to the rectangle or band whose real size is closest: the cost is the worse of the two directions on a log scale, and a rectangle that allows rotation may be turned 90°. A band that tiles only has to match across its height (u repeats). An island is stretched to the fit up to max_stretch; past that it is left unmapped, in the group hotspot_unmatched. Ties take the seeded hash of the island's position, so the same mesh always fits the same way. Search words: hotspot, trim sheet, trim band. Help topic trim_sheets.
Inputs
| # | name | description |
|---|---|---|
| 0 | geometry | faces to fit |
| 1 | sheet | trim sheet (a trim_sheet node; optional: else the one the geometry carries) (optional) |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
group | group (prim) | "" | faces to fit ("" = all) | |
sheet | string | "" | which sheet when several are carried ("" = the only one) | |
max_stretch | float | 2 | 1.. | largest size ratio accepted in the worse direction; an island past it stays in hotspot_unmatched |
seed | float | 0 | random seed |
Writes: vertex uv; prim trim_band, trim_sheet; prim group hotspot_unmatched; detail trim_sheets
Example
{
"nodes": {
"sheet": {
"type": "trim_sheet",
"params": {
"name": "panels",
"resolution": [512, 512],
"texels_per_metre": 256,
"bands": [{ "name": "edge", "height": 0.1 }],
"rects": [
{ "name": "wide", "rect": [0, 128, 256, 128] },
{ "name": "tall", "rect": [256, 128, 128, 256], "rotate": false }
]
}
},
"wall": {
"type": "box",
"params": { "size": [1, 0.5, 0.05], "center": [0, 0.25, 0] }
},
"door": {
"type": "box",
"params": { "size": [0.5, 1, 0.05], "center": [1.2, 0.5, 0] }
},
"parts": { "type": "merge", "in": ["wall", "door"] },
"nrm": { "type": "normal", "in": ["parts"], "params": { "class": "prim" } },
"fit": {
"type": "hotspot",
"in": ["nrm", "sheet"],
"params": { "group": "@N.z>0.5" }
}
},
"output": "fit"
}
Used in the example corridor_panels.
trim_layout#
aliases: trim_bake trim_mesh sheet_layout
Lay a trim sheet out flat at real size, one strip per band, to bake its maps; relief adds the 45° border bevels and rounds edge bands.
The layout lies in the XY plane, the sheet's bottom-left corner at the origin, facing +Z. Each band is a strip x = 0 to its period and y over its real height, with uv filling the band (u 0..1 is one period). Rectangles sit at their place on the sheet. relief builds the high poly for those maps: a 45° chamfer of the band's bevel at each border, an edge band as a quarter-round, and a rectangle as a panel raised by its bevel. Bake with the layout as the low mesh and the relief as the high mesh (bake_normal, bake_ao, bake_curvature). A model placed at the same coordinates lines up with the strips. Help topic trim_sheets.
Inputs
| # | name | description |
|---|---|---|
| 0 | sheet | the trim sheet (a trim_sheet node, or geometry carrying one) |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
sheet | string | "" | which sheet when the input carries several ("" = the only one) aliases: name | |
relief | bool | false | the high poly: 45° bevels, quarter-round edge bands, raised rectangles |
Writes: the strips; vertex uv; prim trim_band, trim_sheet; a prim group per band; detail trim_sheets
Example
{
"nodes": {
"sheet": {
"type": "trim_sheet",
"params": {
"name": "stone",
"resolution": [256, 256],
"texels_per_metre": 128,
"bands": [
{ "name": "wall", "height": 1, "bevel": 0.02 },
{ "name": "edge", "height": 0.1, "kind": "edge" }
]
}
},
"flat": { "type": "trim_layout", "in": ["sheet"] }
},
"output": "flat"
}
trim_map#
aliases: trim_uv trim_project band_map
Map selected faces onto a trim sheet band: u along the faces at the band's period (running on round corners), v across the band; or cut walls into courses one band high.
Faces of the group that share an edge form a strip. On walls (normals within 45° of level) u runs level and v up; on floors and ceilings u runs along the strip's longest edge (along picks another direction). u and v are unfolded across the shared edges, so u carries on round the corners of a wall and v over the fold of a coping. u starts at 0 at the strip's start and repeats every period of the band; a band that does not tile, and a rectangle, fits the strip once. fit says how the strip meets the band across: stretch fills the band with each strip, scale keeps real size from the strip's bottom (higher parts run out of the band: the uv report counts them), courses cuts the faces into rows one band high from the strip's bottom and maps each row onto the whole band (stone courses), adding the cut points to the neighbouring faces so no T-junctions appear. Faces are never mirrored. Search words: trim sheet, trim band, texture a wall, stone courses, uvs along a path. Help topic trim_sheets.
Inputs
| # | name | description |
|---|---|---|
| 0 | geometry | faces to map |
| 1 | sheet | trim sheet (a trim_sheet node; optional: else the one the geometry carries) (optional) |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
group | group (prim) | "" | faces to map ("" = all), e.g. "side", "@P.y>0.1", "!caps" | |
band | string | "" | band (or rectangle) to map onto; "sheet:band" picks a sheet when several are carried aliases: trim_band trim | |
along | enum | "auto" | direction of u: auto = level on walls, the longest edge on floors; x, y, z = that axis laid into each face; longest = the strip's longest edge on every face options: auto x y z longest | |
fit | enum | "stretch" | across the band: stretch = each strip fills it; scale = real size from the strip's bottom; courses = cut into rows one band high, each filling the band options: stretch scale courses | |
connect | bool | true | faces sharing an edge form one strip (u and v run on across the edge); off: every face is its own strip | |
offset | float | 0 | shift u, metres | |
stagger | float | 0 | courses: shift u by this many metres more on each row (a running bond) |
Writes: vertex uv; prim trim_band, trim_sheet; detail trim_sheets
Example
{
"nodes": {
"sheet": {
"type": "trim_sheet",
"params": {
"name": "stone",
"resolution": [512, 512],
"texels_per_metre": 256,
"bands": [
{ "name": "course", "height": 0.5 },
{ "name": "coping", "height": 0.25 }
]
}
},
"plan": {
"type": "shape2d",
"params": { "shape": "rect", "size": [3, 0.4] }
},
"wall": { "type": "extrude", "in": ["plan"], "params": { "height": 1.6 } },
"stone": {
"type": "trim_map",
"in": ["wall", "sheet"],
"params": {
"group": "side",
"band": "course",
"fit": "courses",
"stagger": 0.3
}
},
"top": {
"type": "trim_map",
"in": ["stone"],
"params": { "group": "top", "band": "coping" }
}
},
"output": "top"
}
Used in the examples corridor_panels, stair_flight.
trim_sheet#
aliases: trim trimsheet ultimate_trim hotspot_sheet
Describe a trim sheet once: named bands that tile along u (and hotspot rectangles) at a real size. Mapping, baking, the uv report and the sheet view read it.
A trim sheet is one texture whose horizontal bands each hold a strip of surface that repeats along u: stone courses, a coping, a step nosing, a metal edge. Bands stack from the top of the image downwards; each is height metres tall, so it takes height × texels_per_metre pixel rows (or give rows: [top, bottom] in pixels). Along u a band repeats every period metres (default: the sheet width, resolution[0] / texels_per_metre). kind marks what a band is for: surface, edge (a rounded or bevelled edge strip) or cap (end caps of sweeps and tubes). bevel is the width of the 45° chamfer trim_layout bakes into the band's borders. Rectangles below the bands are hotspots: rect [x, y, width, height] in pixels from the top-left (as Hammer++ .rect files), fitted by hotspot. The output carries no geometry, only the sheet (detail trim_sheets): wire it into the sheet input of sweep, polywire, tube, extrude, trim_map, hotspot or trim_layout. Search words: trim sheet, trim band, hotspot, texture a railing, uvs along a path. Help topic trim_sheets.
Inputs
None (generator).
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
name | string | "trim" | sheet name (mapped prims carry it in trim_sheet; materials may share it) aliases: sheet | |
resolution | ivec2 | [1024,1024] | 1..8192 | sheet image size in pixels [width, height]; the bakes default to it aliases: res image_size |
texels_per_metre | float | 512 | 1.. | texel density: pixels per metre on the model (the sheet width in metres is resolution[0] / this) aliases: texel_density px_per_m tpm |
bands | json | [{"name":"wall","height":1},{"name":"edge","height":0.25,"kind":"edge"},{"name":"trim","height":0.25,"bevel":0.01},{"name":"cap","height":0.5,"kind":"cap","tile":false}] | bands from the top: [{name, height (m), period (m, default the sheet width), tile (default true), kind ("surface" | "edge" | "cap"), bevel (m), rows ([top, bottom] px, instead of stacking)}] aliases: strips trims | |
rects | json | [] | hotspot rectangles: [{name, rect: [x, y, width, height] px from the top-left, rotate (may turn 90°, default true), bevel (m)}] aliases: hotspots rectangles | |
gap | int | 0 | 0.. | empty pixel rows between stacked bands (padding against mip bleed) aliases: padding |
Writes: no geometry; detail trim_sheets (the sheet description, JSON)
Example
{
"nodes": {
"sheet": {
"type": "trim_sheet",
"params": {
"name": "stone",
"resolution": [512, 512],
"texels_per_metre": 256,
"bands": [
{ "name": "wall", "height": 1 },
{ "name": "coping", "height": 0.25, "kind": "edge" },
{ "name": "cap", "height": 0.5, "kind": "cap", "tile": false }
]
}
},
"path": {
"type": "curve",
"params": { "points": [[0, 0, 0], [2, 0, 0], [3, 0, 1]] }
},
"rail": {
"type": "sweep",
"in": ["path", null, "sheet"],
"params": { "shape": "rect", "size": [0.3, 0.2], "trim_band": "coping" }
}
},
"output": "rail"
}
Used in the examples corridor_panels, stair_flight.
uv_autoseam#
aliases: uvautoseam autoseam uv_seams
Experimental: propose UV seams. Writes prim chart (disk-like regions) and point seam = 1 on chart borders, for uv_flatten.
method xatlas uses the xatlas chart segmentation (same weights as uv_unwrap); method normal grows charts over faces within angle of the chart seed normal. Charts without a border (closed) or with handles are split by growing two halves from far-apart faces, so every chart can be flattened. Also writes the "seams" edge group when the geometry supports edge groups. Follow with uv_flatten (chart_attrib "chart").
Inputs
| # | name | description |
|---|---|---|
| 0 | geo | polygon geometry |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
method | enum | "xatlas" | xatlas = chart segmentation by cost; normal = normal clustering by angle options: xatlas normal | |
angle | float | 45 | 1..180 | normal method: max angle between a face and its chart seed normal (degrees) |
max_chart_area | float | -1 | -1.. | xatlas method: as in uv_unwrap (-1 auto, 0 unlimited) |
normal_deviation | float | 2 | 0.. | xatlas method: weight of normal deviation |
max_cost | float | 2 | 0.01.. | xatlas method: lower = more charts |
Writes: prim chart, point seam, edge group seams (when available)
Example
{
"type": "uv_autoseam",
"in": ["geo"],
"params": { "method": "normal", "angle": 50 }
}
uv_flatten#
aliases: uvflatten lscm uv_lscm flatten_uv
Flatten charts with LSCM (least squares conformal maps): angle-preserving UVs per chart, then pack them.
Charts are the polygon regions bounded by seams: edges where the input uv is discontinuous (use_seams), the "seams" edge group, extra point pairs (seams param), changes of a prim chart attribute (e.g. from uv_autoseam or uv_unwrap), and the border of the group. Each chart is pinned at two far-apart border points (or the pins param) and solved by conjugate gradients. Closed charts (no border) and charts with handles are opened by a cut graph first (cut_closed). Each chart is scaled into 0..1, then laid out with uv_layout rules when layout is on.
Inputs
| # | name | description |
|---|---|---|
| 0 | geo | polygon geometry, optionally with uv seams or a chart attribute |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
method | enum | "lscm" | parameterisation: lscm (conformal, implemented); abf (angle-based flattening) is reserved and not implemented yet options: lscm abf | |
group | group (prim) | "" | prims to flatten (others keep their uv); the group border is a seam | |
use_seams | bool | true | cut where the input uv is discontinuous | |
seams | json | [] | extra seam edges as point pairs [[a, b], ...] | |
chart_attrib | string | "chart" | prim attribute whose changes are seams (ignored when missing; "" = off) | |
pins | json | [] | two point numbers to pin in every chart that contains both, e.g. [0, 12]; [] = the two farthest-apart border points | |
cut_closed | bool | true | open closed charts and charts with handles with a cut graph (otherwise they fold) | |
layout | bool | true | pack the charts into the 0..1 square (uniform texel density); off = every chart fills 0..1 on its own | |
padding | float | 4 | 0.. | gap between islands, in texels at resolution (or uv units with units:"uv"); half of it, rounded up, to the tile border |
units | enum | "texels" | unit of padding options: texels uv | |
resolution | int | 1024 | 16..16384 | texture size: padding is in its texels, and islands are placed on its texel grid (at most 2048 cells per tile) |
Writes: vertex uv, prim chart
Example
{ "type": "uv_flatten", "in": ["geo"], "params": { "seams": [[0, 1], [1, 2]] } }
uv_layout#
aliases: uvlayout uvpack uv_pack pack_uv
Pack UV islands into the 0..1 square (or UDIM tiles) without overlaps: rotate to minimal bounds (or keep, or align to the world), equalise texel density, fill every gap.
Islands are polygon regions whose uv is continuous across shared edges, or the values of island_attrib. Each island is oriented (orient: its minimum-area bounding rectangle, as it is, or world up to +v), scaled so texel density is uniform (scale_mode uniform: uv area ∝ 3D area, times the texel_weight attribute) and placed on the texel grid of resolution: bottom-left, into any gap its shape fits (inside rings, between the arms of other islands), padding texels from every other island and half of it from the tile border, so islands never overlap. The scale is the largest at which every island fits (or texels_per_unit); iterations tries other island orders and keeps the densest. fit atlas keeps everything in the 0..1 tile; fit udim fills UDIM tiles 1001, 1002, … (u offset, ten per row; an island goes to the first tile it fits), up to udims. cut_long cuts islands longer than the tile, and rings and arcs, into parts when the parts pack denser (each cut is a seam). visibility_weight gives the faces that show more texels: the density of each polygon is scaled by how much of its hemisphere is open (rays from points spread over it, against the geometry and the optional surroundings input; a quarter of the hemisphere counts as fully open, a wall flush with a face blocks it), so the back of a wall-mounted part or the inside of a closed one shrinks to a twentieth and the rest of the atlas grows. It measures openness, so a face deep inside a recess gets less. A chart that mixes hidden and visible faces is weighted by its mean. An existing prim attribute called visibility is replaced when the weight is above 0. Prim visibility is written; the stats count the faces at the minimum, and a warning says so when a quarter of the area is hidden with no surroundings connected (normals facing inwards). Prims outside group keep their uv and the islands keep clear of them. The result is checked: overlaps inside an island (folds, or pieces joined by island_attrib) come from the input and are reported with the part they are in; islands that do not fit at any scale leave the uv unchanged, with a warning.
Inputs
| # | name | description |
|---|---|---|
| 0 | geo | geometry with uv |
| 1 | surroundings | what stands around the geometry (a wall, the floor, other parts) and blocks its rays for visibility_weight; not laid out and not changed (optional) |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
island_attrib | string | "" | prim attribute defining islands (e.g. "chart"); "" = connected uv regions | |
group | group (prim) | "" | prims to lay out; the others keep their uv and the islands keep clear of them (with padding) | |
orient | enum | "min_rect" | island orientation: min_rect = turned to its minimum bounding rectangle, with 90° turns while packing (densest); keep = as it is, no turns; world = world up (+Y) points to +v (horizontal islands: +X to +u), no turns. Rotations keep the uv winding options: min_rect keep world | |
scale_mode | enum | "uniform" | uniform = same texel density on every island (by 3D area); keep = keep the relative uv scale options: uniform keep | |
texel_weight | string | "texel_weight" | prim attribute scaling the texel density of each island (mean over its polygons by area; 2 = twice the texels per metre, values <= 0 count as 1, so attrib_create with a group weights those parts); missing = all 1 | |
visibility_weight | float | 0 | 0..1 | texel density by visibility, 0..1: texels per metre of each polygon times lerp(1, max(0.05, open), weight), where open is how much of its hemisphere is not blocked by the geometry or the surroundings input (rays from points spread over the polygon by area, unlimited; a quarter of the hemisphere counts as fully open): faces against a wall (also one flush with them) or inside a closed part get a twentieth of the density, open faces keep it, and the rest of the atlas grows. It is openness, so a face deep inside a recess gets less. A chart that mixes hidden and visible faces is weighted by its mean. An existing prim attribute called visibility is replaced when the weight is above 0. 0 = off (the layout is as without it). Writes prim visibility; stats count the faces and the share of the area at the minimum, and a warning says so when a quarter of the area reads hidden with no surroundings connected (normals facing inwards) |
padding | float | 4 | 0.. | gap between islands, in texels at resolution (or uv units with units:"uv"); half of it, rounded up, to the tile border |
units | enum | "texels" | unit of padding options: texels uv | |
resolution | int | 1024 | 16..16384 | texture size: padding is in its texels, and islands are placed on its texel grid (at most 2048 cells per tile) |
texels_per_unit | float | 0 | 0.. | texel density at resolution (texels per world unit with scale_mode uniform); 0 = the largest at which every island fits |
fit | enum | "atlas" | atlas = everything in the 0..1 tile (a texels_per_unit too high for it is lowered, with a warning); udim = UDIM tiles 1001, 1002, …: the islands keep texels_per_unit and spill into more tiles (up to udims), or fill udims tiles at the largest scale options: atlas udim | |
udims | int | 1 | 1..100 | fit udim: the most UDIM tiles to fill |
cut_long | bool | true | cut islands longer than the tile, and rings and arcs whose hull is mostly empty, across their length into parts, when that packs denser (each cut is a seam; prim island tells the parts apart); off = islands stay whole | |
iterations | int | 4 | 1..64 | island orders tried (longest side first, then tallest, largest box, largest area, then shuffles by seed); the densest wins |
seed | float | 0 | random seed | |
write_island | bool | true | write prim int attribute island |
Writes: vertex uv, prim island
Example
{
"nodes": {
"cabinet": {
"type": "box",
"params": { "size": [0.6, 1, 0.3], "center": [0, 0.5, 0.15] }
},
"wall": {
"type": "grid",
"params": {
"size": [6, 6],
"divisions": [1, 1],
"plane": "xy",
"center": [0, 0.5, -0.001]
}
},
"out": {
"type": "uv_layout",
"in": ["cabinet", "wall"],
"params": { "visibility_weight": 1, "padding": 8, "resolution": 2048 }
}
},
"output": "out"
}
Used in the example worn_machine.
uv_project#
aliases: uvproject texture uv_texture
Project UVs: planar, box (tri-planar per face), cylindrical or spherical.
uv = world position / scale + offset (no packing: the uv runs over many tiles, for tiling textures; uv_layout or uv_unwrap make an atlas). planar projects along axis: y → u = x, v = z; x → u = z, v = y; z → u = x, v = y. box projects each polygon the same way along the axis its normal is closest to. Both sides of an axis share one projection, so the faces looking along +X, +Y and -Z get MIRRORED uv (a texture reads backwards there, and their uv winding is opposite to the polygon's: inspect uv counts them as mirrored), while -X, -Y and +Z read the right way round. cylindrical: u = angle around axis (one turn per scale[0]), v = height along axis / scale[1]; spherical: u = angle, v = polar angle (0..1 times scale[1]); both measured from center. u starts at the seam (the seam param, an angle around the axis) and grows turning right-handed about the axis. A face that the seam runs through keeps its own short stretch of u (its corners stay one turn apart from the neighbour on the far side), so the seam falls on the edges between faces and a whole number of tiles per turn wraps without a visible seam; a point on the axis (a pole, a cone tip) takes the u of its face. For cylindrical and spherical scale[0] is the TILE COUNT around the axis (a number of repeats, not a length: 1 = the texture wraps the surface once, 4 = four repeats), so one count gives surfaces of different radii different tile sizes (a 0.4 m post and a 3.6 m drum both get scale[0] tiles around): to keep tiles the same size, give each radius its own count, about 2π · radius / tile width. scale[1] is metres per v tile for cylindrical. A cylindrical projection collapses the flat top and bottom faces of a tube or ring (all their points share one height, so the uv degenerates to a line): put those faces in a prim group and run a second uv_project with method box or planar and that group; group limits a projection to its prims and leaves the uv of the others untouched.
Inputs
| # | name | description |
|---|---|---|
| 0 | geo | geometry |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
group | group (prim) | "" | prims to project ("" = all); the other prims keep their uv | |
method | enum | "box" | projection type options: box planar cylindrical spherical | |
axis | enum | "y" | projection axis (planar normal / cylinder axis) options: y x z | |
scale | vec2 | [1,1] | box/planar: world units per UV tile; cylindrical/spherical: scale[0] is the number of tiles around the axis (a count, not a length), scale[1] is metres per tile along the axis (cylindrical) or the number of tiles pole to pole (spherical) | |
offset | vec2 | [0,0] | uv offset | |
center | vec3 | [0,0,0] | projection center (cyl/sph) | |
seam | float | 0 | cylindrical/spherical: where the seam (u = 0) lies, in degrees around the axis, turning right-handed about it (counter-clockwise seen from +axis). 0 = towards -Z for axis y (-Y for axis x, -X for axis z); axis y: 90 = -X, 180 = +Z, 270 = +X. Put it where nobody looks aliases: seam_angle |
Writes: vertex uv
Example
{
"type": "uv_project",
"params": { "method": "cylindrical", "axis": "y", "seam": 90 }
}
Used in the examples fracture_settle, image_cutouts, lsystem_tree, machined_bracket, material_set, scifi_panel.
uv_transform#
aliases: uvtransform
Translate / scale / rotate existing UVs (vertex or point uv).
Inputs
| # | name | description |
|---|---|---|
| 0 | geo | geometry with uv |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
translate | vec2 | [0,0] | offset aliases: t | |
scale | vec2 | [1,1] | scale aliases: s | |
rotate | float | 0 | degrees aliases: r | |
pivot | vec2 | [0.5,0.5] | pivot |
Example
{
"nodes": {
"box": { "type": "box" },
"uv": { "type": "uv_project", "in": ["box"], "params": { "method": "box" } },
"tiled": {
"type": "uv_transform",
"in": ["uv"],
"params": { "scale": [2, 2], "rotate": 90 }
}
},
"output": "tiled"
}
Used in the example weathered_cabinet.
uv_unwrap#
aliases: uvunwrap autouv xatlas uv_auto unwrap
Automatic UV unwrap: xatlas cuts and flattens charts per connected piece; they are packed without overlaps into the 0..1 square. Polygons are kept.
Charts grow over faces of similar orientation (weights below); each chart is flattened (LSCM, planar or ortho). Every connected piece is charted on its own, so a small part of a merged model unwraps as it would alone. Polygons are triangulated for xatlas; the output keeps the polygons, with per-corner uv (seams split vertices, not points). A polygon xatlas cuts across two charts becomes its triangles (straddling split), so its uv stays exact. Faces with no area are not charted: their uv collapses onto a neighbour's chart. A chart that folds onto itself is charted again (xatlas at a lower cost, then a conformal map) and, if it still folds, cut where it overlaps. Thin charts (bevel strips) join a neighbouring chart where their seam lines up (merge_thin); charts longer than the tile, rings and arcs are cut into parts when that packs denser (cut_long). The charts are packed like uv_layout: oriented (orient), on the texel grid of resolution, padding texels apart, uniform texel density times the texel_weight attribute (and, with visibility_weight, times how open each polygon is: against the geometry and the optional surroundings input, so hidden faces get a twentieth of the texels; it is openness, so a face deep inside a recess gets less; a chart that mixes hidden and visible faces is weighted by its mean; an existing prim attribute called visibility is replaced when the weight is above 0), never overlapping, into the 0..1 tile (fit atlas) or more tiles at a fixed texels_per_unit (fit udim or stack); the result is checked and every warning names the part. Big smooth meshes chart slowly: max_chart_area -1 (auto) limits chart size above ~1000 triangles; a higher max_cost makes fewer, larger charts (less padding). Noisy surfaces (scans, decimated or generated models) shatter into many ragged charts whatever the weights: chart_smoothing cuts and flattens the charts on a smoothed copy and keeps the uv on the real shape. Writes prim chart (and atlas with fit stack).
Inputs
| # | name | description |
|---|---|---|
| 0 | geo | polygon geometry (polylines are skipped) |
| 1 | surroundings | what stands around the geometry (a wall, the floor, other parts) and blocks its rays for visibility_weight; not unwrapped and not changed (optional) |
Parameters
| name | type | default | range | description |
|---|---|---|---|---|
use_seams | bool | false | keep existing seams: edges where uv is discontinuous, and a "seams" edge group, become chart borders xatlas never crosses (seams that do not cut a region apart are hints only) | |
chart_smoothing | int | 0 | 0..1000 | smoothing passes (taubin, as smooth) on a copy that the charts are cut and flattened on; the uv goes onto the real shape and packs by its areas. Noisy surfaces (scans, decimated or generated models) shatter into hundreds of ragged charts; 30 to 100 passes make a few smooth ones. 0 = off |
max_chart_area | float | -1 | -1.. | largest chart area in world units²; 0 = unlimited (xatlas default), -1 = auto (unlimited below ~1000 triangles, then total area * 1000 / triangles to keep charting fast) |
max_boundary_length | float | 0 | 0.. | longest chart boundary in world units (0 = unlimited) |
normal_deviation | float | 2 | 0.. | weight of the angle between a face and the chart average normal aliases: normal_deviation_weight |
roundness | float | 0.01 | 0.. | weight of chart roundness aliases: roundness_weight |
straightness | float | 6 | 0.. | weight of straight chart boundaries aliases: straightness_weight |
normal_seam_weight | float | 4 | 0.. | weight of normal seams (hard edges); > 1000 always cuts there |
texture_seam_weight | float | 0.5 | 0.. | weight of existing texture seams |
max_cost | float | 2 | 0.01.. | a chart stops growing when the weighted cost exceeds this; lower = more, flatter charts |
max_iterations | int | 1 | 1..16 | chart growing/seeding iterations (higher = better charts, slower) |
straddling | enum | "split" | a polygon xatlas cuts across charts: split = it becomes its triangles, each with its chart's exact uv; unfold = it stays one polygon, its other corners mapped onto its main chart (can overlap a neighbour) options: split unfold | |
padding | int | 2 | 0..64 | texels between charts (half of it, rounded up, to the tile border) |
resolution | int | 1024 | 16..16384 | texture size: padding is in its texels and charts are placed on its texel grid |
texels_per_unit | float | 0 | 0.. | texel density (texels per world unit); 0 = the largest density at which every chart fits one tile |
fit | enum | "atlas" | charts that do not fit one tile at texels_per_unit: atlas = a lower density so they fit the 0..1 tile, udim = keep the density and fill more tiles to the right (1002, 1003, …), stack = more atlases all in 0..1 (prim atlas tells them apart) options: atlas udim stack | |
orient | enum | "min_rect" | chart orientation: min_rect = turned to its minimum bounding rectangle, with 90° turns while packing (densest); world = world up (+Y) points to +v (horizontal charts: +X to +u), no turns; keep = as charted. Rotations keep the uv winding options: min_rect world keep | |
merge_thin | bool | true | join thin charts (bevel strips, narrow bands: narrower than three paddings) onto a neighbouring chart where their shared seam lines up and nothing overlaps, so fewer charts lose space to padding (and fewer seams); off = the charts as cut | |
cut_long | bool | true | cut charts longer than the tile, and rings and arcs whose hull is mostly empty, across their length into parts, when that packs denser (each cut is a seam); off = charts stay whole | |
texel_weight | string | "texel_weight" | prim attribute scaling the texel density of each chart (mean over its polygons by area; 2 = twice the texels per metre, values <= 0 count as 1, so attrib_create with a group weights those parts); missing = all 1 | |
visibility_weight | float | 0 | 0..1 | texel density by visibility, 0..1: texels per metre of each polygon times lerp(1, max(0.05, open), weight), where open is how much of its hemisphere is not blocked by the geometry or the surroundings input (rays from points spread over the polygon by area, unlimited; a quarter of the hemisphere counts as fully open): faces against a wall (also one flush with them) or inside a closed part get a twentieth of the density, open faces keep it, and the rest of the atlas grows. It is openness, so a face deep inside a recess gets less. A chart that mixes hidden and visible faces is weighted by its mean. An existing prim attribute called visibility is replaced when the weight is above 0. 0 = off (the layout is as without it). Writes prim visibility; stats count the faces and the share of the area at the minimum, and a warning says so when a quarter of the area reads hidden with no surroundings connected (normals facing inwards) |
iterations | int | 4 | 1..64 | chart orders the packer tries; the densest wins |
uv_attrib | string | "uv" | the vertex uv set to write (e.g. "uv2" for a second set of masks or lightmaps; the uv the materials use stays as it is) aliases: uv_name output_uv |
Writes: vertex uv (or the uv_attrib set), prim chart, prim atlas (fit stack with several atlases), prim visibility (visibility_weight above 0)
Example
{
"nodes": {
"ball": { "type": "sphere", "params": { "type": "ico", "level": 4 } },
"shape": {
"type": "noise_displace",
"in": ["ball"],
"params": { "amplitude": 0.35, "frequency": 1.2 }
},
"rough": {
"type": "noise_displace",
"in": ["shape"],
"params": { "amplitude": 0.06, "frequency": 9 }
},
"rock": { "type": "decimate", "in": ["rough"], "params": { "ratio": 0.4 } },
"out": {
"type": "uv_unwrap",
"in": ["rock"],
"params": { "chart_smoothing": 60, "padding": 4, "resolution": 1024 }
}
},
"output": "out"
}
Used in the examples asset_cleanup, blob_creature, rusty_drum, weathered_cabinet, worn_machine.