Skip to content

Shader Profiles Overview

Overview of shader profiles defined in the extractor (StaticMaterial.cs). These profiles map shader paths (and their FNV1a hashes) to parameter conventions used for material extraction and GLTF export.

Each profile sets which parameters to read for textures, tint, flipbooks, scrolling, and bloom. Frontend code relies on these resolved values; no frontend-side guessing of shader params is needed.

VFX Material Parameters

VFX emitter meshes (e.g., noodle effects) can have UV scroll and scale parameters defined in VfxEmitterDefinitionData rather than StaticMaterialDef. The extractor now supports:

  • birthUvScrollRateuvScrollSpeed in material extras
  • uvScaleuvTile in material extras

These parameters override StaticMaterial values when present, allowing particle-attached meshes to have animated textures independent of their base material shader.

Profiles (one page per shader)

Hash-Based Resolution

  • Each profile also maps to its FNV1a32 hash for cases where shader path is stored as an ObjectLink hash.
  • Matching order: exact path → hash → substring fallback (extracts name from path).

Frontend Expectations

  • Scroll parameters feed handleUvScroll/handleUvTile (from either StaticMaterial or VfxEmitterDefinitionData).
  • Rotation parameters feed handleUvRotation for animated texture rotation around a center point.
  • Flipbook parameters feed either flipbookKeyframes (accessory hash) or flipbookEvents (TFT) depending on shader and material flags.
  • Bloom flag controls material pipeline decisions for effects.
  • UV scroll and rotation respect animation time scale and pause state for synchronized playback.
  • AlphaIntensity (from AlphaIntensityParam) controls material opacity separate from color tint alpha.

Default Profile

  • If no specific profile matches, the default uses FlipbookSize and standard texture/tint fallbacks; avoid relying on it for custom shaders.

Built for engineers and AI assistants working on Khada.