Appearance Overrides
The iTwin.js renderer provides the ability to dynamically override various aspects of the appearance of Features (roughly correlating to GeometricElements) within tiles. The renderer uses the feature table embedded in each tile to produce a lookup table from which the vertex shader can obtain the overrides. The following aspects can be overridden using FeatureOverrides:
- Color and transparency.
- Line width and style.
- Visibility - whether the feature is drawn at all.
- Emphasis - a silhouette effect applied to features to make them stand out.
- Locatability - the ability for tools to interact with the feature.
- Whether or not to apply the feature's material.
Appearance overrides can be applied on the basis of any combination of model, element, subcategory, geometry class, and - for animated views - animation node Id. They are aggregated from a variety of sources including:
- The visible categories specified by the CategorySelector;
- The per-Model, per-SubCategory, and per-GeometryClass overrides specified by the display style;
- The RenderTimeline script controlling the view's animation;
- The display style's PlanProjectionSettings;
- FeatureAppearanceProviders supplied by tile trees;
- Any number of FeatureOverrideProviders registered with the Viewport.
Many applications make use of the higher-level but more limited EmphasizeElements API to apply appearance overrides. This sample demonstrates some of the capabilities.
In the image below, EmphasizeElements has applied emphasis to a handful of elements while fading out the rest of the elements by overriding their color and transparency:
Last Updated: 13 May, 2024