Skip to content

Add KHR_materials_sheen export support#8279

Merged
willeastcott merged 1 commit intomainfrom
gltf-exp-sheen
Dec 19, 2025
Merged

Add KHR_materials_sheen export support#8279
willeastcott merged 1 commit intomainfrom
gltf-exp-sheen

Conversation

@willeastcott
Copy link
Contributor

@willeastcott willeastcott commented Dec 19, 2025

This PR adds export support for the KHR_materials_sheen glTF extension to the GltfExporter.

Changes

GltfExporter (src/extras/exporters/gltf-exporter.js)

  • Export KHR_materials_sheen extension when material.useSheen is true:
    • sheenColorFactor from material.sheen (linear converted, if not black)
    • sheenRoughnessFactor from material.sheenGloss (if not 0)
    • sheenColorTexture from material.sheenMap
    • sheenRoughnessTexture from material.sheenGlossMap
  • Added sheenMap and sheenGlossMap to texture semantics

glTF Extension Reference

The KHR_materials_sheen extension adds a sheen layer to simulate the appearance of cloth and fabric materials. The sheen BRDF models the microfiber structure of textiles.

Example Output

{
  "extensions": {
    "KHR_materials_sheen": {
      "sheenColorFactor": [0.8, 0.4, 0.2],
      "sheenRoughnessFactor": 0.5
    }
  }
}

Notes

  • glTF's default sheenColorFactor is [0, 0, 0] (black/no sheen), so we export whenever sheen color is non-black
  • The parser sets sheenGlossInvert = true, so sheenGloss directly maps to glTF's sheenRoughnessFactor

Checklist

  • I have read the contributing guidelines
  • My code follows the project's coding standards
  • This PR focuses on a single change

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds export support for the KHR_materials_sheen glTF extension, enabling the exporter to output sheen material properties that simulate cloth and fabric appearances.

Key Changes:

  • Added sheen color and roughness factor export with appropriate default handling
  • Added sheen texture export support (color and roughness maps)
  • Registered sheen texture semantics for proper texture collection

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@willeastcott willeastcott merged commit 068e6e3 into main Dec 19, 2025
13 checks passed
@willeastcott willeastcott deleted the gltf-exp-sheen branch December 19, 2025 14:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement Request for a new feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants