-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
Support multiple expressions in a 3D Tiles Style #5153
Comments
Should this be a string or a list of strings with keys? |
Ah that comment is out of date now, it should be a list of string with keys. I'll edit the post. |
Just to mention: "expression" is currently mentioned in spec, but not supported by PointClouds. In general this is a really useful feature, but hard to implement, because you need to know result types of any operation to create new variables in glsl (there is no |
It is supported, but only for conditions. Maybe that should change. Here's an example with the 3D Tiles Point Cloud Styling sandcastle:
Agreed that it could be hard to get the variable type, but I think it is possible with the existing code in Also good point about the performance implications. Right now the expression is handled by string replacement and it would be ideal for this to change. |
An idea Jane gave for this: |
Thanks @Jane-Of-Art and @Dylan-Brown for those notes, I'll keep that in mind for #5232 |
In order to make this easier to use for all styles, not just condition styles, the
I'll work on adding that to #5232 |
Fixed in #5232 but will rename |
@Dylan-Brown, @Jane-Of-Art for after #4759
Currently an
expression
may be computed by the style and referenced multiple times by the style to minimize computation and keep styles concise.It would be convenient to extend this to support multiple expressions, as outline here:
From CesiumGS/3d-tiles#2 (comment)
Most of the code changes will go in
ConditionsExpression.js
.This will also include spec changes, so we'll need to be careful about certain details. For example, some expression names are reserved, like
POSITION
,POSITION_ABSOLUTE
,NORMAL
, andCOLOR
: https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/Styling#point-cloudAlso should an expression called
"id"
be referenced by"${ID}"
or"${id}"
or"${_ID}"
or"${_id}"
? What happens when a feature has the same property name? This doesn't need to be decided right now, but should be considered.The text was updated successfully, but these errors were encountered: