Options
All
  • Public
  • Public/Protected
  • All
Menu

This is the general interface that describes a Mesh style object.

The Mesh style object defines styling expressions used by TileSet3DLayer layer to style Mesh data. All properties are optional.

since

2019.0

Hierarchy

  • MeshStyle

Overview

Properties

Optional colorExpression

colorExpression: Expression<Color> | null

An expression to specify what colors to apply to mesh data.

To create expressions, you must use the factory methods in the ExpressionFactory module. The expression must be well-formed and resolve to a color value.

If you want to update the styling very often, consider using parameters in your expression. Changing the values of parameters is more efficient than replacing the whole expression.

If you define a colorExpression, the texture data, if any, will not be displayed. The color expression will determine the color.

Note that the alpha component of the color is ignored so the color will be fully opaque, unless you enable transparency.

default

null If not set, the mesh will use the texture data of the mesh, if any.

Optional displacementExpression

displacementExpression: Expression<Vector3> | null

An expression to displace mesh data.

To create expressions, you must use the factory methods in the ExpressionFactory module. The expression must be well-formed and resolve to a point value.

If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than replacing the whole expression.

  // Example of a displacement expression that pushes down everything inside a shape.
  var _  = ExpressionFactory;
  var shape = _.orientedBox(layer.orientedBox);
  meshStyle.displacementExpression =  _.pushDown(shape);
default

null meshes are not displaced by default.

since

2020.0

Optional facetCulling

facetCulling: FacetCullingType

This setting determines which side of the surfaces (facets) that make up a mesh are omitted (culled) from the rendering result.

When rendering meshes, all surfaces that make up the mesh face a certain direction. This direction is often called the normal direction. This normal is used to determine if the surface is being seen from the front or the back. When rendering objects that have no holes in them, it is only possible to see the front of all surfaces. Graphics pipelines therefore often don't render the back sides of those surfaces to speed up rendering.

Apart from performance, some applications are made possible by enabling back-face culling. Consider for example a mesh that represents a room. Its normals would all point to the inside of the room. When enabling back-face culling, you can see the walls and floor of the room, without having to move the camera inside the room itself.

In some cases however, enabling back-face culling (i.e. not rendering the back-side of surfaces) can have undesired artifacts. This can for example happen:

  • for objects with incorrect normals. In that case, you will for example only see the inside of a mesh instead of the outside
  • for objects with holes in them. In that case, you won't be able to see the inside of the mesh, even when looking through the hole

Both can be resolved by disabling culling.

By default, no culling takes place and both sides of a surface are painted.

  // Example of enabling backface culling
  meshStyle.facetCulling = FacetCullingType.BACKFACE_CULLING;
since

2021.0.1

Optional lighting

lighting: boolean

Boolean indicating whether lighting effects should be applied to the mesh.

The map allows you to apply graphics effects. This boolean indicates whether the lighting graphical effects should be applied to meshes styled with this style.

default

true

Optional pbrSettings

pbrSettings: PBRSettings | null

Configures the PBR shading effects applied to the mesh.

default

null

since

2021.1

Optional selectedColorExpression

selectedColorExpression: Expression<Color> | null

An expression to specify what colors to apply to selected mesh data.

To create expressions, you must use the factory methods in the ExpressionFactory module. The expression must be well-formed and resolve to a color value. This value can also be set to null to prevent selection from changing the color.

If you want to update the styling very often, consider using parameters in your expression. Changing the values of parameters is more efficient than replacing the whole expression.

If you define a selectedColorExpression, the texture data, if any, will not be displayed while selection is active for the selected part of the mesh. The color expression will determine the color.

import {color, defaultColor, multiply} from "@luciad/ria/util/expression/ExpressionFactory";
import {OGC3DTilesModel} from "@luciad/ria/model/tileset/OGC3DTilesModel";
import {TileSet3DLayer} from "@luciad/ria/view/tileset/TileSet3DLayer";

layer.meshStyle = {
  selectedColorExpression: multiply(color("rgb(255,148,76)"), defaultColor()),
  lighting: false
};

Note that the alpha component of the color is ignored so the selection color will be fully opaque.

since

2020.0

default

An orange color expression.

Optional visibilityExpression

visibilityExpression: Expression<boolean> | null

An expression to filter mesh data.

To create expressions, you must use the factory methods in the ExpressionFactory module. The expression must be well-formed and resolve to a boolean value.

If you want to update the styling very often, consider using parameters in your expressions. Changing the values of parameters is more efficient than replacing the whole expression.

  // Example of a visibility expression that makes everything inside a shape invisible.
  var _  = ExpressionFactory;
  var shape = _.orientedBox(layer.orientedBox);
  meshStyle.visibilityExpression =  _.not(_.isInside(shape));
default

null meshes are visible by default.

since

2020.0

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Type alias with type parameter
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method