diff --git a/extensions/2.0/Vendor/BENTLEY_materials_point_style/README.md b/extensions/2.0/Vendor/BENTLEY_materials_point_style/README.md new file mode 100644 index 0000000000..1d1e414641 --- /dev/null +++ b/extensions/2.0/Vendor/BENTLEY_materials_point_style/README.md @@ -0,0 +1,50 @@ + + +# BENTLEY_materials_point_style + +## Contributors + +* Paul Connelly, Bentley Systems, [@pmconne](https://github.com/pmconne) +* Mark Schlosser, Bentley Systems, [@markschlosseratbentley](https://github.com/markschlosseratbentley) +* Daniel Zhong, Bentley Systems, [@danielzhong](https://github.com/danielzhong) + +## Status + +Draft + +## Dependencies + +Written against the glTF 2.0 spec. + +## Overview + +Points are fundamental elements in many 3D modeling and computer-aided design (CAD) environments. In such visualizations, individual point primitives may differ in their styling, mainly focused around their diameter in screen pixels. Such diameter can be used to indicate a variety of meanings useful to CAD applications. + +This specification describes a minimal extension sufficient to meet Bentley Systems' requirements in supporting CAD-style visualizations of points using glTF. + +## Specifying Point Styles + +The `BENTLEY_materials_point_style` extension is applied to a material. When that material is used by a `POINTS` primitive (indicated by a value of `0` for [`mesh.primitive.mode`](https://registry.khronos.org/glTF/specs/2.0/glTF-2.0.html#_mesh_primitive_mode)), the extension dictates the diameter of those points in pixels. + +### Diameter + +The `diameter` property specifies the diameter of each point in CSS pixels. When specified, this value must be greater than zero. + +For each point, implementations should render the point such that a filled circle is centered at the point's CSS pixel screen position with a pixel diameter equal to `diameter`. This point faces the camera. + +Note: The term "CSS pixel" follows the [CSS3 definition](https://www.w3.org/TR/css-values-3/#absolute-lengths). Per that definition, the CSS pixel is defined as $1\text{px} = \frac{1}{96}\text{th}\ \text{of}\ 1\text{in}$, which this specification adopts for clarity and stability. + +## Implementation Notes + +Some graphics APIs may not require that implementations directly support point sizes greater than one. For example, [Section 3.4 of the OpenGL ES 3.0 Specification](https://registry.khronos.org/OpenGL/specs/es/3.0/es_spec_3.0.pdf) only guarantees a maximum point size of at least one via `ALIASED_POINT_SIZE_RANGE`. In such cases, points with diameters greater than one could be rendered as quads which are shaped into circles using a shader. + +## JSON Schema + +* [material.BENTLEY_materials_point_style.schema.json](schema/material.BENTLEY_materials_point_style.schema.json) + +## Known implementations + +* [iTwin.js](https://github.com/iTwin/itwinjs-core/pull/8835) diff --git a/extensions/2.0/Vendor/BENTLEY_materials_point_style/schema/material.BENTLEY_materials_point_style.schema.json b/extensions/2.0/Vendor/BENTLEY_materials_point_style/schema/material.BENTLEY_materials_point_style.schema.json new file mode 100644 index 0000000000..c9c1da0c6a --- /dev/null +++ b/extensions/2.0/Vendor/BENTLEY_materials_point_style/schema/material.BENTLEY_materials_point_style.schema.json @@ -0,0 +1,19 @@ +{ + "$schema": "https://json-schema.org/draft/2020-12/schema", + "title": "BENTLEY_materials_point_style extension", + "type": "object", + "description": "Specifies point diameter for CAD-style visualization.", + "allOf": [ + { "$ref": "glTFProperty.schema.json" } + ], + "properties": { + "diameter": { + "type": "integer", + "description": "Diameter of the point in screen pixels. Must be > 0.", + "minimum": 1 + }, + "extensions": {}, + "extras": {} + }, + "required": ["diameter"] +}