Skip to content

applyHierarchicalPresets

applyHierarchicalPresets(texture, instanceOptions?, loaderOptions?): void

Defined in: packages/three-flatland/src/loaders/TextureLoader.ts:180

Apply hierarchical texture presets to a texture.

Useful when you need to override presets after loading, or when using Three’s TextureLoader directly.

Hierarchy (highest to lowest priority):

  1. instanceOptions (per-call override)
  2. loaderOptions (loader-level default)
  3. TextureConfig.options (texture-specific default)
  4. FlatlandConfig.options (library-wide default)
  5. ‘pixel-art’ (system default)

Texture 

TexturePreset | TextureOptions

TexturePreset | TextureOptions

void

// Override presets on an already-loaded texture
const texture = await TextureLoader.load('/sprite.png')
applyHierarchicalPresets(texture, 'smooth') // Override to smooth filtering