Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
339604b
draft wip
markschlosseratbentley Sep 11, 2025
ab1e2b6
update README & schema
danielzhong Nov 11, 2025
546eb74
Update README.md
danielzhong Nov 12, 2025
915a7b0
Update README.md
danielzhong Nov 13, 2025
1fbbb15
rename
danielzhong Nov 13, 2025
dd40552
Update material.BENTLEY_material_line_style.schema.json
danielzhong Nov 13, 2025
b93d51d
Update extensions/2.0/Vendor/BENTLEY_material_line_style/README.md
danielzhong Nov 13, 2025
17f8c12
Update extensions/2.0/Vendor/BENTLEY_material_line_style/README.md
danielzhong Nov 13, 2025
d1cbb59
Update extensions/2.0/Vendor/BENTLEY_material_line_style/README.md
danielzhong Nov 13, 2025
f82a869
Update extensions/2.0/Vendor/BENTLEY_material_line_style/README.md
danielzhong Nov 13, 2025
32923b7
Update README.md
danielzhong Nov 13, 2025
00ad2d4
copyright
markschlosseratbentley Nov 20, 2025
14bea10
contributor list
markschlosseratbentley Nov 20, 2025
2b3fc30
Update material.BENTLEY_material_line_style.schema.json
danielzhong Nov 21, 2025
0ec3508
materials plural
markschlosseratbentley Nov 21, 2025
98d282c
materials plural
markschlosseratbentley Nov 21, 2025
535c58b
plural
markschlosseratbentley Nov 21, 2025
e3db76e
update
danielzhong Nov 26, 2025
2c4af97
Update README.md
danielzhong Dec 8, 2025
7b35020
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong Dec 8, 2025
5bcbd1d
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong Dec 8, 2025
35e0630
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong Dec 8, 2025
4c4c1c4
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong Dec 8, 2025
384fe75
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong Dec 8, 2025
c6a75f2
Update README.md
danielzhong Dec 8, 2025
10ada04
Merge branch 'BENTLEY_materials_line_style' of https://github.com/Ces…
danielzhong Dec 8, 2025
42e2055
Update README.md
danielzhong Dec 9, 2025
28cfc25
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/schema/mate…
danielzhong Dec 19, 2025
57d373b
Add CumulativeDistance
danielzhong Jan 26, 2026
3368ec3
Update extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
danielzhong Jan 29, 2026
f8ed3d0
update
danielzhong Jan 29, 2026
8563506
Update README.md
danielzhong Jan 29, 2026
6823cd3
Update README.md
danielzhong Feb 11, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
94 changes: 94 additions & 0 deletions extensions/2.0/Vendor/BENTLEY_materials_line_style/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<!--
Copyright 2026 Bentley Systems, Incorporated
SPDX-License-Identifier: CC-BY-4.0
-->

# BENTLEY_materials_line_style

## Contributors

* Paul Connelly, Bentley Systems, [@pmconne](https://github.com/pmconne)
* Daniel Zhong, Bentley Systems, [@danielzhong](https://github.com/danielzhong)
* Mark Schlosser, Bentley Systems, [@markschlosseratbentley](https://github.com/markschlosseratbentley)

## Status

Draft

## Dependencies

Written against the glTF 2.0 spec.

## Overview

Lines are fundamental elements in many 3D modeling and computer-aided design (CAD) environments. They are used to annotate two- and three-dimensional visualizations, with variations in width and dash patterns conveying semantic meaning or emphasis.

The `BENTLEY_materials_line_style` extension defines a method for describing the visual style of lines within glTF material. It enables authors to specify line thickness and a repeating dash pattern.
The extension is also applied to line-type primitives to indicate the presence of a per-vertex cumulative distance attribute semantic used for stable dash alignment.

This extension introduces two primary properties controlling line appearance:

* `width`: the pixel width of the rendered line
* `pattern`: an unsigned integer whose bits represent a repeating on/off pattern along the line

## Specifying Line Styles

The `BENTLEY_materials_line_style` extension is applied to a material. When that material is used by any line-type primitive, or by the edges described by the [`EXT_mesh_primitive_edge_visibility`](https://github.com/KhronosGroup/glTF/pull/2479) extension, it defines the **width** and **pattern** with which those lines are rendered.

When applied to a line-type primitive, the extension indicates that the primitive supplies the per-vertex cumulative distance attribute semantic defined below.

### Width

The `width` property specifies the line's thickness **in screen pixels**. The value of `width` must be greater than `0`.

For each line segment, implementations should extrude geometry by half this width on each side of the segment's centerline, perpendicular to its direction. Implementations should also insert triangles at the joints between line segments comprising a continuous line string or line loop, when appropriate to visually round out the joints.

### Pattern

The `pattern` property specifies a **repeating on/off bit pattern** applied along the length of the line, encoded as a 16-bit unsigned integer. Each bit corresponds to one screen pixel:

* Bit value `1`: lit (on)
* Bit value `0`: unlit (off)

The least significant bit (bit 0) corresponds to the start of the pattern. The pattern repeats cyclically after all 16 bits have been used. If a pattern requires fewer than 16 bits, its unused higher-order bits must be `0`.

The pattern must be applied continuously along each continuous line string or line loop so that connected segments remain visually consistent. Implementations must not restart the pattern at intermediate vertices within the same line string.

Example patterns:

| Bit Pattern (hex) | Binary | Description |
|--------------------|---------|----------------|
| `0xFFFF` | 1111111111111111 | solid line |
| `0xAAAA` | 1010101010101010 | dotted line |
| `0xF0F0` | 1111000011110000 | dashed line |
| `0xC3C3` | 1100001111000011 | custom pattern |

### Cumulative Distance (Primitive Attribute)

When the extension is applied to a line-type primitive, the primitive must supply a vertex attribute with the semantic:

* `BENTLEY_materials_line_style:CUMULATIVE_DISTANCE`

This attribute provides a per-vertex **cumulative distance** from the start of the line string, expressed in model/world units. Implementations use this distance to align the dash pattern consistently along the full line string.

The accessor for this attribute:

* **MUST** be `SCALAR`.
* **MUST** have a count matching the primitive's vertex count.
* **MUST** use component type `FLOAT` **OR** a normalized integer type.

Values are expected to be non-decreasing along each line string.

## Implementation Notes

Because many graphics APIs do not support line primitives with a width larger than 1, tessellation is generally required to draw wide lines.

Copy link
Author

@markschlosseratbentley markschlosseratbentley Jan 29, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

## JSON Schema

* [material.BENTLEY_materials_line_style.schema.json](schema/material.BENTLEY_materials_line_style.schema.json)
* [mesh.primitive.BENTLEY_materials_line_style.schema.json](schema/mesh.primitive.BENTLEY_materials_line_style.schema.json)

## Known implementations

* [iTwin.js](https://github.com/iTwin/itwinjs-core/pull/8856)
* [Cesium.js](https://github.com/CesiumGS/cesium/pull/13110)
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "BENTLEY_materials_line_style glTF Material Extension",
"type": "object",
"description": "glTF extension that specifies line width and a GPU-friendly dash pattern for CAD-style visualization.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"width": {
"type": "integer",
"description": "Width of the line in screen pixels.",
"minimum": 1,
"default": 1,
"gltf_detailedDescription": "The thickness of the line in screen pixels. Must be greater than 0. Implementations typically render wide lines via tessellated geometry extruded from the line centerline."
},
"pattern": {
"type": "integer",
"description": "Unsigned integer bitfield encoding a repeating on/off pattern along the line.",
"minimum": 0,
"default": 65535,
"gltf_detailedDescription": "An unsigned integer whose bits encode a repeating on/off pattern along the line. Bit value 1 indicates a lit (on) segment, and bit value 0 indicates an unlit (off) segment. The least significant bit (bit 0) corresponds to the start of the pattern and represents the first segment drawn along the line. The bit pattern repeats cyclically once all supported bits have been consumed. If a pattern uses fewer bits than the maximum supported width, unused higher bits MUST be set to zero. For example, a value of 0xFFFF produces a solid line, and a value of 0xAAAA produces a dotted line."
},
"extensions": {},
"extras": {}
},
"required": []
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"$schema": "https://json-schema.org/draft/2020-12/schema",
"title": "BENTLEY_materials_line_style glTF MeshPrimitive Extension",
"type": "object",
"description": "Indicates that a mesh primitive supplies the BENTLEY_materials_line_style cumulative distance attribute semantic.",
"allOf": [
{
"$ref": "glTFProperty.schema.json"
}
],
"properties": {
"extensions": {},
"extras": {}
},
"required": []
}