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

Partial translucency on globe #8752

Closed
OmarShehata opened this issue Apr 13, 2020 · 2 comments · Fixed by #8726
Closed

Partial translucency on globe #8752

OmarShehata opened this issue Apr 13, 2020 · 2 comments · Fixed by #8726

Comments

@OmarShehata
Copy link
Contributor

This PR #8726 is going to add support for globe translucency so you can visualize underground data.

It was requested on the forum to be able to turn on this translucency just for an area of the globe, instead of the whole thing: https://community.cesium.com/t/viewing-tiles-under-surface-imagery-obscures-tiles/9290/2. The use case there is that you have a house, and want to show what's underneath the house but still keep the surrounding ground solid.

In the meantime, the workaround to accomplish this would be to use clipping planes on the globe .

@lilleyse
Copy link
Contributor

There are some pretty hacky ways to do this with the globe translucency PR, like using an imagery cutout on the opaque layer and adding another imagery layer with alpha.

var viewer = new Cesium.Viewer('cesiumContainer', {
    orderIndependentTranslucency : false
});
var scene = viewer.scene;
var globe = scene.globe;

globe.baseColor = Cesium.Color.TRANSPARENT;
globe.undergroundColor = undefined;

var layers = viewer.imageryLayers;
var imageryBaseLayer = layers.get(0);

var defaultImageryLayerCutout = Cesium.Rectangle.fromDegrees(-90, 20, -70, 40);
imageryBaseLayer.cutoutRectangle = defaultImageryLayerCutout;

var alphaImagery = Cesium.createWorldImagery();
var alphaLayer = layers.addImageryProvider(alphaImagery);
alphaLayer.alpha = 0.5;

clip2

@lilleyse lilleyse mentioned this issue Apr 30, 2020
13 tasks
@lilleyse
Copy link
Contributor

This was added to the API in #8726, no longer need to use the hacky code above.

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

Successfully merging a pull request may close this issue.

2 participants