Skip to content

Anisotropy

Related reference: Scene API / Rendering and Materials

Anisotropy is mainly used to improve texture clarity when viewed at oblique angles. Typical cases include:

  • ground surfaces
  • large-area textures
  • distant planes
  • model surfaces with lots of fine detail

API

js
await api.setAnisotropy(obj, 8);

Parameters

js
await api.setAnisotropy(target, num, mapType, recursive);
  • target: the target object
  • num: the anisotropy value, usually a power of two
  • mapType: the texture field name, default is map
  • recursive: whether the change should also apply to child nodes, default is false

Examples

Increase Anisotropy for the Main Texture on a Model

js
await api.setAnisotropy(model, 16, 'map', true);

Increase Anisotropy for the Normal Map

js
await api.setAnisotropy(model, 8, 'normalMap', true);

Notes

  • Higher values are not always better. They also add rendering cost.
  • This works best on large textures viewed at strong angles.
  • It will not have any effect on materials that do not have the specified texture map.

A good starting point is usually 4, 8, or 16.