Skip to content

Materials and textures ​

A tree usually has two materials: bark (a texture that repeats along the stems) and leaves (cut-out cards from an atlas). Each is a PBR material node connected to a mesher.

The same tree with plain colours (left) and with PBR textures (right)

Texture slots ​

SlotColour spaceContentBarkLeaves
base_colorsRGBalbedo, no lighting baked in; its alpha cuts leaves outyesyes
opacitylinearcoverage when the alpha is not in the base colour (white = solid)—yes
normallineartangent-space normal; its convention (OpenGL or DirectX) is recordedyesyes
roughnesslinear1 = rough; a smoothness map works with Invertyesyes
metalliclinearalmost always empty for treesrare—
occlusionlinearambient occlusion, white = openyesoptional
heightlinearwhite = high; 16-bit kept as it isyes—
translucencysRGBlight through the leaf—yes
tint_masklinearwhere a per-instance tint appliesoptionaloptional
emissivesRGBemitted light——

Each slot stores the file, its Colour space, its Channel (r, g, b, a, rgb or rgba) and, for normals, its Convention. The channel lets one packed file (a Unity mask map, an ORM texture) feed several slots without splitting it.

Two rules that are never guessed silently:

  • Colour data is sRGB; everything else is linear. The slot's default follows this; you can override it.
  • The normal convention travels with the texture. Inside AskrGarden every normal is OpenGL (+Y, green up). A DirectX normal map is flipped when it is written for a target that wants OpenGL. The convention comes from the manifest, the slot setting, or a file-name hint (_N_DX, _dx) shown as a warning.

Factors and alpha ​

FieldKeyWhat it does
Colourbase_color_factorRGBA multiplier (linear); the colour when there is no texture
Roughness, Metallicroughness_factor, metallic_factormultipliers
Normal strength, Occlusion strengthnormal_scale, occlusion_strengthhow strong those maps are
Alpha / Alpha cutoffalpha_mode, alpha_cutoffopaque for bark; mask cuts leaves at the cutoff
Two-sideddouble_sidedrender both faces (leaves)
Tile sizetile_size_mworld size of one texture tile, meters (bark UV density)
Atlas regionsatlasleaf rectangles [u0, v0, u1, v1] in the texture
Translucencytranslucency_factorhow much light passes through (leaves)

Adding a texture in the editor ​

A texture field shows the picture. You can:

  • click Browse and pick a file, or drop a picture on the field;
  • drop a picture on the material node in the graph (it becomes the base colour);
  • open From project and pick one of the images the project can reach. The picker groups them by where they live: Project folder, Library textures, and App textures (copied into the project).

Any picture the browser can read (JPEG, PNG, WebP…) is converted to PNG and stored in the project's textures/ folder. Texture options holds the colour space, channel, convention and invert of that slot.

Bark mapping ​

The goal is the same texel density everywhere, no stretching on thin twigs and no visible repeats.

  • u goes around the stem, v along it.
  • Tiles around (uv_tiles_around on the Bark mesher) is a whole number per stem, worked out from its base radius and the material's Tile size when left at 0, so the seam never shows a cut.
  • v advances with world length divided by the tile size, so bark keeps its proportions.
  • UV jitter gives each stem a random offset, so neighbours do not show the same pattern.

Leaves ​

  • Use mask alpha, a cutoff around 0.5 and Two-sided on.
  • Put several leaves in one texture and list them in Atlas regions; the Leaves node picks one per card by the weights in Atlas variants.
  • When AskrGarden writes a leaf texture on export, it spreads the colour into the transparent area, so mipmaps do not get dark halos.
  • In the engine, turn on coverage-preserving mipmaps for the leaf texture, so leaves do not thin out with distance (Unity).

From a texture set: PBrokkR ​

PBrokkR (formerly PBRGenerator), AskrGarden's sibling tool, turns a photo or a height map into a tileable PBR set and writes a <prefix>_manifest.json that describes every map. Point the material's PBRGenerator manifest field at it and every slot fills itself with the right colour space, channel and normal convention, plus the tile size in meters. A slot you set by hand still wins over the manifest. Details and the one-file .pbrpack: Texture packs and PBrokkR.

How each format receives the maps ​

SlotglTF / GLBFBXUSDOBJ + MTL
base colour (+ alpha)baseColorTexture, alpha modeDiffuseColor (+ TransparentColor)diffuseColor, opacitymap_Kd, map_d
normalnormalTexture (OpenGL)NormalMapnormalnorm (+ map_Bump)
roughness, metallicpacked into one metallicRoughnessTexture (G rough, B metal)texture referencesroughness, metallicmap_Pr, map_Pm
occlusionocclusionTexturecustom propertyocclusion—
heightcopied, listed in extras.treegencustom propertydisplacementdisp
translucencycopied, listed in extras.treegencustom property——

When a format has no slot for a map, the file is still written and listed in the export manifest, so an import script can wire it.