Skip to main content

Recipe: PBR textures from a photo

Goal: take one photo of a surface (brick, fabric, wood, metal) and generate a full PBR material set you can drop into a game engine or DCC tool.

Nodes you'll use: Image Input → the texture nodes (Albedo, Normal, Roughness, Ambient Occlusion, Cavity, Height).

In the Workflow Builder​

  1. Add an Image Input node and point it at your surface photo.
  2. Add the texture nodes you want — each produces one map:
    • Albedo — base color (lighting removed)
    • Normal — surface direction detail
    • Roughness — how matte/shiny
    • Ambient Occlusion — contact shadows
    • Cavity — fine crevice detail
    • Height — displacement
  3. Connect Image Input → each texture node (fan the input out to all of them).
  4. Save, then Run.

Each node outputs its map as a new file; download them together (select all → Download, or zip with a Zip Folder node).

Several maps have a fast classical version and an ML version (e.g. Albedo vs AlbedoML). The ML variants are higher quality on tricky materials and use a GPU worker; the classical ones are quick and CPU-friendly.

Over the API​

BASE=https://dev-api.modtechlabs.com

# Get a Bearer token from your sk_ key (see /api-reference#authentication)
TOKEN=$(curl -s -X POST "$BASE/api-keys/token" -H "Content-Type: application/json" \
-d '{"api_key": "sk_your_key_here"}' | jq -r .access_token)
AUTH="Authorization: Bearer $TOKEN"

# Upload the surface photo
COG=$(curl -s -X POST "$BASE/cogs/upload-file" -H "$AUTH" \
-F "file=@./brick.jpg" | jq -r .id)

# Run your saved "PBR texture set" workflow version against it
curl -s -X POST "$BASE/workflows/workflow-versions/<your_version_id>/run" -H "$AUTH" \
-H "Content-Type: application/json" -d "{\"cog_ids\": [$COG]}"

Tips​

  • Shoot the surface flat and evenly lit — even lighting helps the albedo node separate color from shadow.
  • Run a whole folder of surfaces at once with batch mode.
  • Tune node values at runtime with extra_variables — call GET /workflows/workflow-versions/{id}/variables to see the exact keys your workflow accepts. See the API Reference.