-
Notifications
You must be signed in to change notification settings - Fork 470
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add point cloud styling section #138
Changes from 2 commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -23,9 +23,9 @@ Example: Creating a color ramp based on building height. | |
* Gabby Getz, [@ggetz](https://github.com/ggetz) | ||
* Matt Amato, [@matt_amato](https://twitter.com/matt_amato) | ||
* Tom Fili, [@CesiumFili](https://twitter.com/CesiumFili) | ||
* Sean Lilley, [@lilleyse](https://github.com/lilleyse) | ||
* Patrick Cozzi, [@pjcozzi](https://twitter.com/pjcozzi) | ||
|
||
|
||
Contents: | ||
|
||
* [Overview](#overview) | ||
|
@@ -40,6 +40,7 @@ Contents: | |
* [RegExp](#regexp) | ||
* [Conversions](#conversions) | ||
* [Variables](#variables) | ||
* [Point Cloud](#point-cloud) | ||
* [Notes](#notes) | ||
* [File Extension](#file-extension) | ||
* [MIME Type](#mime-type) | ||
|
@@ -469,6 +470,37 @@ ${temperatures.values[0]} === 70 | |
${temperatures['values'][0]} === 70 // Same as (temperatures[values])[0] and temperatures.values[0] | ||
``` | ||
|
||
### Point Cloud | ||
|
||
In addition to evaluating a point's `color` and `show` properties, a point cloud style may evaluate `pointSize`, or the size of each point in pixels. The default `pointSize` is `1.0`. | ||
```json | ||
{ | ||
"color" : "color('red')", | ||
"pointSize" : "${Temperature} * 0.5" | ||
} | ||
``` | ||
|
||
Implementations may clamp the evaluated `pointSize` to the system's supported point size range. For example, WebGL renderers may query `ALIASED_POINT_SIZE_RANGE` to get the system limits when rendering with `POINTS`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Perhaps say that a pointSize of 1.0 must be supported. |
||
|
||
Point cloud styles may also reference per-point semantics including position, color, and normal to allow for more flexible styling of the source data. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "semantics from the Feature Table" |
||
* `${POSITION}` is an array of three values representing the xyz coordinates of the point before the `RTC_CENTER` and tile transform are applied. When the positions are quantized, `${POSITION}` refers to the position after the `QUANTIZED_VOLUME_SCALE` is applied, but before `QUANTIZED_VOLUME_OFFSET` is applied. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Precisely say what coordinate system that is using the same terms in the point cloud spec. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also precisely say the type of each component, e.g., |
||
* `${COLOR}` evaluates to a Color type, where each of the rgba color components are in the range `0.0` to `1.0`. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Precisely state component type. |
||
* `${NORMAL}` is an array of three values representing the normal of the point before the tile transform is applied. When normals are oct-encoded `${NORMAL}` refers to the decoded normal. | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Precisely state coordinate system and component type. |
||
|
||
For example: | ||
|
||
```json | ||
{ | ||
"color" : "${COLOR} * color('red')'", | ||
"show" : "${POSITION}[0] > 0.5", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should these be arrays or .xyz and .rgba? I get that the later is more work since we have to introduce a vec3 type to the styling language, but it is more natural. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah vec3/vec4 is more natural and is how a styling shader would implements it, as well as makes more sense in terms of math operations. |
||
"pointSize" : "${NORMAL}[0] > 0 ? 2 : 1" | ||
} | ||
``` | ||
|
||
#### Point Cloud Shader Styling | ||
|
||
**TODO : add note about GLSL implementations requires strict type comparisons among other things: https://github.com/AnalyticalGraphicsInc/cesium/issues/3241** | ||
|
||
### Notes | ||
|
||
Comments are not supported. | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"$schema" : "http://json-schema.org/draft-04/schema", | ||
"id" : "pnts.style.schema.json", | ||
"title" : "Point Cloud Style", | ||
"type" : "object", | ||
"description" : "A 3D Tiles style with additional properties for Point Clouds.", | ||
"allOf" : [{ | ||
"$ref" : "style.schema.json" | ||
}, { | ||
"properties" : { | ||
"pointSize": { | ||
"oneOf": [{ | ||
"$ref": "style.numberExpression.schema.json" | ||
}, { | ||
"$ref": "style.condition.schema.json" | ||
}], | ||
"description": "Determines the size of the points in pixels.", | ||
"default": 1.0 | ||
} | ||
} | ||
}], | ||
"additionalProperties" : false | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"$schema" : "http://json-schema.org/draft-04/schema", | ||
"id" : "style.numberExpression.schema.json", | ||
"title" : "number expression", | ||
"type" : ["number", "string"], | ||
"description" : "3D Tiles style expression that evaluates to a number." | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Be more explicit here about what a point cloud is; mention the title type and link to it.