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.

Texture slots
| Slot | Colour space | Content | Bark | Leaves |
|---|---|---|---|---|
base_color | sRGB | albedo, no lighting baked in; its alpha cuts leaves out | yes | yes |
opacity | linear | coverage when the alpha is not in the base colour (white = solid) | — | yes |
normal | linear | tangent-space normal; its convention (OpenGL or DirectX) is recorded | yes | yes |
roughness | linear | 1 = rough; a smoothness map works with Invert | yes | yes |
metallic | linear | almost always empty for trees | rare | — |
occlusion | linear | ambient occlusion, white = open | yes | optional |
height | linear | white = high; 16-bit kept as it is | yes | — |
translucency | sRGB | light through the leaf | — | yes |
tint_mask | linear | where a per-instance tint applies | optional | optional |
emissive | sRGB | emitted 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
| Field | Key | What it does |
|---|---|---|
| Colour | base_color_factor | RGBA multiplier (linear); the colour when there is no texture |
| Roughness, Metallic | roughness_factor, metallic_factor | multipliers |
| Normal strength, Occlusion strength | normal_scale, occlusion_strength | how strong those maps are |
| Alpha / Alpha cutoff | alpha_mode, alpha_cutoff | opaque for bark; mask cuts leaves at the cutoff |
| Two-sided | double_sided | render both faces (leaves) |
| Tile size | tile_size_m | world size of one texture tile, meters (bark UV density) |
| Atlas regions | atlas | leaf rectangles [u0, v0, u1, v1] in the texture |
| Translucency | translucency_factor | how 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.
ugoes around the stem,valong it.- Tiles around (
uv_tiles_aroundon 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. vadvances 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
maskalpha, 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
| Slot | glTF / GLB | FBX | USD | OBJ + MTL |
|---|---|---|---|---|
| base colour (+ alpha) | baseColorTexture, alpha mode | DiffuseColor (+ TransparentColor) | diffuseColor, opacity | map_Kd, map_d |
| normal | normalTexture (OpenGL) | NormalMap | normal | norm (+ map_Bump) |
| roughness, metallic | packed into one metallicRoughnessTexture (G rough, B metal) | texture references | roughness, metallic | map_Pr, map_Pm |
| occlusion | occlusionTexture | custom property | occlusion | — |
| height | copied, listed in extras.treegen | custom property | displacement | disp |
| translucency | copied, listed in extras.treegen | custom 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.