CesiumGS / cesium

An open-source JavaScript library for world-class 3D globes and maps :earth_americas:
https://cesium.com/cesiumjs/
Apache License 2.0
12.8k stars 3.46k forks source link

DistanceDisplayCondition for 3dtiles #7733

Open windcatcher opened 5 years ago

windcatcher commented 5 years ago

is anyway to set DistanceDisplayCondition for 3dtiles?

hpinkos commented 5 years ago

@windcatcher This is not currently supported, but I'll leave this issue open as a feature request and we'll give you an update if we decide to implement this. Thanks!

likangning93 commented 5 years ago

@windcatcher showing/hiding at various distances is also somewhat implicit in 3D Tiles with geometric error, so as a workaround in the meantime you could try adjusting the tileset's maximumScreenSpaceError to see if this meets your needs. Please be aware that this could modify level-of-detail at all viewing distances, not just the distance at which the tileset should be hidden.

https://cesiumjs.org/Cesium/Build/Documentation/Cesium3DTileset.html?classFilter=cesium3dtileset#maximumScreenSpaceError

OmarShehata commented 5 years ago

I think a more fine grained way to do this would be to use the tile viewingRequestVolume:

https://github.com/AnalyticalGraphicsInc/3d-tiles/tree/master/specification#viewer-request-volume

It looks like this is something you don't set at runtime? It sounds like it's essentially distanceDisplayCondition for 3D Tiles. Might be good to have a Sandcastle example of how it works.

mramato commented 5 years ago

The real question I would like to see answers is what is the use case that this feature would solve? As @likangning93 stated, individual tiles from 3D Tiles are inherently hidden or shown based on view distances so that the optimal sets of tiles is currently available for the current view. DistanceDisplayCondition is almost always used to a poor-mans version of what 3D Tiles is already doing.

@windcatcher can you share what you are trying to accomplish that makes you think you need this feature?

apopiak commented 5 years ago

I have a (probably different) use case: I'd like to define normal 3DTilesStyle show conditions based on this. So something like:

{
"show": {
  "conditions": [
    ["${SEMANTIC_CLASS_ATTRIBUTE} === <some id> && ${DISTANCE} > min && ${DISTANCE} < max", "true"]
  ]
}
apopiak commented 5 years ago

But just having

style.distanceDisplayCondition = `vec2(${near}, ${far})`;

work would also be cool.

OmarShehata commented 5 years ago

@apopiak is your use case for hiding certain features, like buildings? Or something else?

apopiak commented 5 years ago

It is for hiding/showing certain pointcloud features at certain distances (e.g. "show all points labelled as trees between 3m and 25m from the camera").

On Wed, May 15, 2019 at 4:27 PM Omar Shehata notifications@github.com wrote:

@apopiak https://github.com/apopiak is your use case for hiding certain features, like buildings? Or something else?

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/AnalyticalGraphicsInc/cesium/issues/7733?email_source=notifications&email_token=ABVBKYQDS7SYYTZPO6M6QGLPVQMUFA5CNFSM4HEX4X4KYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVO2WKA#issuecomment-492677928, or mute the thread https://github.com/notifications/unsubscribe-auth/ABVBKYRHELV45I6NFU4PM53PVQMUFANCNFSM4HEX4X4A .