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

Consider adding mutables to styling language #252

Closed
pjcozzi opened this issue Jul 21, 2017 · 2 comments
Closed

Consider adding mutables to styling language #252

pjcozzi opened this issue Jul 21, 2017 · 2 comments

Comments

@pjcozzi
Copy link
Contributor

pjcozzi commented Jul 21, 2017

via @SunBlack:

{
    "mutables" : {
        "lengthFactor" : { type: "float", value: 0.1 },
        "idFactor" : { type: "int", value: 5 }
    },
    "defines" : {
        "length" : "length(${POSITION})",
        "time" : "${tiles3d_tileset_time} * 0.1"
    },
    "color" : {
        "conditions" : [
            ["${length} < ${lengthFactor}", "${length} * color('red')"],
            ["${length} < 5 * ${lengthFactor}", "vec4(vec3(${temperature} * fract(${time})), 1.0)"],
            ["${id} < 150 * ${idFactor}", "vec4(${secondaryColor} / 5.0, 1.0)"],
            ["${id} < 200 * ${idFactor}", "rgb(0, 0, Number(${secondaryColor}.x < 0.5) * 255)"]
        ]
    },
    "show" : "${length} < 0.9"
}

Full discussion: CesiumGS/cesium#5380 (comment)

@lilleyse
Copy link
Contributor

A CesiumJS implementation was started in CesiumGS/cesium#5380. The code is parked at Cesium3DTileStyle_uniform_support.

@lilleyse lilleyse removed the next label Nov 15, 2021
@lilleyse lilleyse mentioned this issue Nov 15, 2021
85 tasks
@lilleyse
Copy link
Contributor

CesiumJS has custom shaders which may be a better approach.

May also be considered for future styling language updates: #2 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants