All skills
freshtechbro avatar

/substance-3d-texturing

@1da73fe

Comprehensive skill for Adobe Substance 3D Painter texturing and material creation workflow. Use this skill when creating PBR materials, exporting textures for web/game engines, optimizing 3D assets for real-time rendering, or automating texture workflows. Triggers on tasks involving Substance 3D Painter, PBR texturing, material creation, texture export for Three.js, Babylon.js, Unity, Unreal, glTF optimization, or Python API automation. Creates optimized textures for threejs-webgl, react-three-fiber, and babylonjs-engine materials.

Use this Skill: https://skilld.dev/gh/freshtechbro/claudedesignskills/substance-3d-texturing

This session only. Nothing lands on disk.

assetsREADME.md

≈1.9k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Substance 3D Texturing Assets

Pre-configured export preset templates for various web engines and platforms.

Directory Structure

assets/
└── export_templates/
    ├── gltf_standard.json          # glTF 2.0 compliant preset
    ├── threejs_optimized.json      # Three.js with separate channels
    ├── babylonjs_pbr.json          # Babylon.js PBR format
    ├── web_orm_packed.json         # ORM channel packing
    └── mobile_webgl.json           # Mobile-optimized preset

Usage

Method 1: Copy Preset Configuration

Copy the JSON content from any template file and use directly in your Python script:

import json
import substance_painter.export

# Load preset from file
with open('assets/export_templates/gltf_standard.json', 'r') as f:
    custom_preset = json.load(f)

config = {
    "exportPath": "C:/export",
    "exportPresets": custom_preset["exportPresets"],
    "exportList": [{"rootPath": "MyAsset", "exportPreset": "glTF_Standard"}],
    "exportParameters": [{
        "parameters": {"paddingAlgorithm": "infinite"}
    }]
}

result = substance_painter.export.export_project_textures(config)

Method 2: Use Preset Generator Script

Generate presets programmatically:

# Generate glTF preset
.claude/skills/substance-3d-texturing/scripts/generate_export_preset.py --preset gltf --output my_preset.json

# Interactive mode
.claude/skills/substance-3d-texturing/scripts/generate_export_preset.py

Preset Descriptions

gltf_standard.json

Format: glTF 2.0 compliant Resolution: 1024×1024 Outputs:

  • baseColor.png - RGB base color (sRGB)
  • normal.png - RGB normal map (OpenGL format)
  • metallicRoughness.png - Packed: G=Roughness, B=Metallic

Best for:

  • glTF/GLB export
  • Generic WebGL applications
  • Three.js, Babylon.js (standard workflow)

threejs_optimized.json

Format: Three.js MeshStandardMaterial Resolution: 1024×1024 Outputs:

  • color.jpg - JPEG base color (smaller file size)
  • normal.png - RGB normal map
  • ao.png - Ambient occlusion
  • metalness.png - Metallic channel
  • roughness.png - Roughness channel

Best for:

  • Three.js projects requiring separate channels
  • Maximum flexibility (individual map control)
  • When file size is less critical than editability

babylonjs_pbr.json

Format: Babylon.js PBRMaterial Resolution: 1024×1024 Outputs:

  • albedo.png - Base color
  • normal.png - Normal map
  • metallicRoughness.png - Packed: G=Roughness, B=Metallic

Best for:

  • Babylon.js PBR workflows
  • Similar to glTF but with Babylon naming conventions

web_orm_packed.json

Format: ORM (Occlusion-Roughness-Metallic) Packed Resolution: 1024×1024 Outputs:

  • baseColor.png - RGB base color
  • normal.png - RGB normal map
  • ORM.png - Packed: R=AO, G=Roughness, B=Metallic

Best for:

  • Maximum efficiency (3 textures instead of 6)
  • Production web applications
  • When texture count matters more than editability

Texture memory savings: ~50% reduction


mobile_webgl.json

Format: Mobile-optimized Resolution: 512×512 Outputs:

  • color.jpg - JPEG base color (aggressive compression)
  • normal.png - RG normal map (reconstruct Z in shader)
  • packed.png - R=AO, G=Roughness, B=Metallic

Best for:

  • Mobile web applications
  • Low-end devices
  • When load time and memory are critical

File size: ~3MB total vs. ~16MB standard

Customization

All presets can be customized by modifying the JSON files:

Change Resolution

Modify the sizeLog2 parameter:

  • 9 = 512×512
  • 10 = 1024×1024 (default)
  • 11 = 2048×2048
  • 12 = 4096×4096
{
  "parameters": {
    "sizeLog2": 11  // Change to 2048×2048
  }
}

Change File Format

Modify the fileFormat parameter:

  • "png" - Lossless (recommended for data maps)
  • "jpeg" - Lossy compression (good for baseColor)
  • "tga" - Targa format
  • "exr" - HDR format (32-bit)
{
  "parameters": {
    "fileFormat": "jpeg"  // Change to JPEG
  }
}

Add Custom Channels

Add new map entries to pack additional channels:

{
  "fileName": "$textureSet_emissive",
  "channels": [
    {"destChannel": "R", "srcChannel": "R", "srcMapType": "documentMap", "srcMapName": "emissive"},
    {"destChannel": "G", "srcChannel": "G", "srcMapType": "documentMap", "srcMapName": "emissive"},
    {"destChannel": "B", "srcChannel": "B", "srcMapType": "documentMap", "srcMapName": "emissive"}
  ],
  "parameters": {"fileFormat": "png", "bitDepth": "8", "sizeLog2": 10}
}

Integration Examples

Three.js with glTF Preset

import * as THREE from 'three';
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader.js';

const loader = new GLTFLoader();

loader.load('model.glb', (gltf) => {
  // Textures automatically loaded from glTF
  scene.add(gltf.scene);
});

Three.js with Separate Textures

import * as THREE from 'three';

const textureLoader = new THREE.TextureLoader();

const material = new THREE.MeshStandardMaterial({
  map: textureLoader.load('Asset_color.jpg'),
  normalMap: textureLoader.load('Asset_normal.png'),
  aoMap: textureLoader.load('Asset_ao.png'),
  metalnessMap: textureLoader.load('Asset_metalness.png'),
  roughnessMap: textureLoader.load('Asset_roughness.png'),
});

// Set color space for baseColor
material.map.colorSpace = THREE.SRGBColorSpace;

Babylon.js with PBR Preset

import { PBRMaterial, Texture } from '@babylonjs/core';

const pbr = new PBRMaterial("pbr", scene);
pbr.albedoTexture = new Texture("Asset_albedo.png", scene);
pbr.bumpTexture = new Texture("Asset_normal.png", scene);
pbr.metallicTexture = new Texture("Asset_metallicRoughness.png", scene);

// Configure channel reading
pbr.useRoughnessFromMetallicTextureGreen = true;
pbr.useMetallnessFromMetallicTextureBlue = true;

ORM Packed Workflow

// Three.js with ORM texture
const ormTexture = textureLoader.load('Asset_ORM.png');

material.aoMap = ormTexture;        // Reads from Red channel
material.roughnessMap = ormTexture; // Reads from Green channel
material.metalnessMap = ormTexture; // Reads from Blue channel

Troubleshooting

Preset not found in Substance:

  • Presets are for custom export via Python API only
  • Not visible in Substance UI preset dropdown
  • Use via Python scripts or plugins

Wrong channel order:

  • Verify glTF spec: G=Roughness, B=Metallic
  • Unreal uses different packing: R=AO, G=Roughness, B=Metallic
  • Check engine documentation for channel expectations

Textures too large:

  • Reduce sizeLog2 (e.g., 10 → 9 for 512px)
  • Use mobile preset for aggressive optimization
  • Convert baseColor to JPEG post-export

Normal map inverted:

  • Substance uses OpenGL format (Y+)
  • If using DirectX engine, flip green channel
  • Or use engine setting to flip normal Y

Additional Resources

License

These preset templates are provided as examples and can be freely modified for your projects.

Source: SKILL.md on GitHub

No alerts16d5 checks · Risk SAFE
  • Gen Agent Trust Hub16d

    The skill provides tools and documentation for Adobe Substance 3D Painter workflows. It includes Python scripts for batch exporting and optimizing textures for web use, along with JSON templates for various engines. Analysis of the code and instructions found no security issues; the scripts perform standard file operations within the application environment, and all external references are to trusted documentation or services.

  • Socket16d

    No alerts

  • Snyk16d

    Risk: LOW · No issues

  • Runlayer7mo

    3/13 files flagged

  • ZeroLeaks5mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 1da73fe. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Dormantupdated 11 months ago

README badge

README badge for freshtechbro/claudedesignskills/substance-3d-texturing