Hair Cards 

A hair card is a flat piece of geometry with hair drawn onto it as a texture, rather than as individual strands. Cards are what real-time engines and games use in place of full hair: a few hundred of them can stand in for hundreds of thousands of strands at a fraction of the cost.

The App builds them from a groom you already have. Rendering Hair as Mesh Geometry generates the flat card geometry, and its Create Hair Cards action wires up everything needed to texture them: a layout that packs every card into one shared image, called an atlas, and a Hair Card Atlas operator that renders each card's hair into it.

 

The hair card atlas 

Selecting the Hair Card Atlas operator opens its tool, which shows the packed atlas with every card outlined as an island. Click an island to select it, or Ctrl+click to add to the selection. Selecting an island also brings up the groom that generates its card, so you can edit that card's parameters without leaving the tool.

Two rows below the atlas hold the cards themselves:

  • Hair Cards - the hair card grooms installed with the App. Picking one assigns a fresh copy of it to every selected island.
  • Variations - the presets saved inside the groom the selection shows, plus the groom as it was authored. Picking one applies its values to every selected island, so choosing a card and a variation of it are two clicks in the same place.

The Atlas Layout group holds three controls. The first chooses which channel the preview displays; this is a preview control only and does not change what the atlas outputs. The second is the Resolution the atlas is rasterized at for the viewport and the renderers - higher resolutions are sharper but cost more to rebuild after every edit. The third is Anti-Aliasing, which decides how many times each texel of the atlas is sampled: Off takes a single sample at the texel's centre, and 2x2, 3x3 and 4x4 take that grid of samples across it and combine them into one value.

A hair card is drawn from strand geometry whose coverage has no in-between - a point is either inside a strand or outside it - so at a single sample per texel every strand edge is either fully opaque or fully absent, and raising the Resolution alone only makes that staircase finer rather than smooth. Anti-aliasing is what turns each edge into a fraction of coverage. New atlases use 2x2. The cost is the square of the setting, so 4x4 samples each texel sixteen times and takes correspondingly longer to rebuild.

 

Channels 

A hair card carries more than a colour. The Channels group decides which of the channels the atlas can render are actually used, and that one selection serves two purposes: a channel switched on is both shaded with in the viewport and written out when the atlas is exported, and switching it off drops it from both.

Five channels reach the viewport material, and all five are enabled by default:

  • Alpha - coverage, marking where hair covers the card and where the card is transparent. This is what cuts each card's silhouette out of its quad; switch it off and cards render as whole rectangles.
  • Base Color - the colour of the hair on the card. Switched off, the cards shade white.
  • Normal - the surface direction of the individual fibre covering each pixel, so every hair painted into a card catches light as a round strand instead of the whole card shading as one flat plane.
  • Flow - the direction each fibre runs across the card, which is what gives the hair its swept, silky highlight rather than one highlight shared by the entire card.
  • Ambient Occlusion - how much of the surrounding light reaches each pixel, baked from the hair around it. This is what gives a braid, a twist or a knot its depth; without it every strand is lit as though it had open sky above it and the weave flattens out.

The remaining channels - Root To Tip Gradient, Depth, Id, Color Id, Roughness and Anisotropy - are written by an export but are not shaded with in the viewport. Each checkbox's tooltip says which of the two it affects. Color Id has one further use outside the material: the viewport can draw the cards in it, described below.

 

Baking maps against the cards 

The atlas channels above are baked from each card's own hair, which is all a card knows about. Anything that depends on where a card sits in the finished groom - how deeply it lies under the hair around it, the shadow the cards above it cast on it, the way two layers of cards occlude one another where they cross - has to be baked in whichever application the cards are assembled in, against the whole mesh rather than against a single card.

That cannot be baked against the channel the card textures themselves use. That channel gives the cards of a strand group one shared island on purpose: a dozen cards then read one card's worth of texture at the resolution of the whole island, rather than each getting a fraction of the atlas, which is what makes the atlas worth its size. It also means those cards share texels, so whatever is baked onto one of them comes back out on all of them.

Baking needs the opposite layout: every card in an island of its own, so that no two cards share a texel, and a gutter of empty atlas around each island, because a baker spreads what it bakes past an island's edge.

The Add Bake UV Channel button, in the Mapping Channels group of the Hair Cards tool, sets a second mapping channel up that way in one step - a per-strand atlas with one island per card and a gutter around each. The first channel is left exactly as it is, so the card textures keep the shared islands they were authored against. Both layouts are then carried by the same mesh, and the target application reads the baked map back by sampling the second coordinate set: in Unreal, a Texture Coordinate node with its Coordinate Index set to 1.

Each of those settings can also be set by hand, per channel; see Rendering Hair as Mesh Geometry.

 

Reading a groom by its card colours 

Once cards overlap one another it stops being obvious which card a piece of the hairstyle belongs to: they are all hair coloured, and the one thing you cannot see is the card. The atlas already answers that question as its Color Id channel, which gives every card a flat colour of its own, and the viewport can draw the cards in it.

Set the viewport display mode to Color Id, either from the display mode icon in the top left corner of the viewport or from the Shading entries of the viewport settings menu. Hair cards are then drawn flat and unlit in their Color Id, and strands in the colour of the strand group they belong to, so the same partition can be read upstream of the cards as well as on them.

The colours are the ones the Color Id map is baked from. The viewport samples the atlas channel itself rather than computing a second palette that resembles it, so a card's colour on screen and its colour in an exported atlas_ColorId.png are the same colour and can be compared directly.

Cards keep their alpha cutout in this mode, so they still show their hair silhouette rather than plain rectangles, and nothing about the groom or about what the atlas outputs changes - it is a display mode.

One thing worth knowing: a card's Color Id is derived from the strands on it, so two islands showing copies of the same card groom carry the same strands and come out the same colour. That is a property of the channel rather than of the display, and the baked map shows them the same way.

 

Exporting the atlas 

The Export group writes the enabled channels to image files, so the cards can be taken into a game engine or another application.

  • Format - the image format to write.
  • Separate file per channel or Single file with layers - one image per channel, or all channels in one layered image. The layered option is only available for formats that support layers.
  • File - where to write. The path is remembered with the groom, and you are asked for one the first time you save if it is still empty.
  • Save Hair Card Atlas - writes the files. Disabled until at least one channel is enabled.

With separate files, each channel goes to its own file named after the base path with the channel name appended: exporting Alpha and Base Color to atlas.png writes atlas_Alpha.png and atlas_BaseColor.png, and leaves atlas.png itself untouched.

 

Related 

Missing Something? Let us know if this page needs more information about the topic.