Skip to content
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

Merged
merged 3 commits into from
Jan 10, 2017
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
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
34 changes: 33 additions & 1 deletion Styling/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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`.
Copy link
Contributor

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.

```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`.
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Also precisely say the type of each component, e.g., float.

* `${COLOR}` evaluates to a Color type, where each of the rgba color components are in the range `0.0` to `1.0`.
Copy link
Contributor

Choose a reason for hiding this comment

The 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.
Copy link
Contributor

Choose a reason for hiding this comment

The 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",
Copy link
Contributor

Choose a reason for hiding this comment

The 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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The 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.
Expand Down
23 changes: 23 additions & 0 deletions Styling/schema/pnts.style.schema.json
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
}
7 changes: 7 additions & 0 deletions Styling/schema/style.numberExpression.schema.json
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."
}
2 changes: 1 addition & 1 deletion Styling/schema/style.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
}, {
"$ref" : "style.condition.schema.json"
}],
"description" : "Determines the 'highlight color' multiplied with the feature's intrinsic color.",
"description" : "Determines the color blended with the feature's intrinsic color.",
"default" : "Color('#FFFFFF')"
},
"meta" : {
Expand Down