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

use single color to render the back side of terrain #8942

Open
vinstics opened this issue Jun 10, 2020 · 5 comments
Open

use single color to render the back side of terrain #8942

vinstics opened this issue Jun 10, 2020 · 5 comments

Comments

@vinstics
Copy link

Thanks for improving the underground navigation experience. It's important when dealing with some underground project. But sometimes it's hard to distinguish if the current view point is underground because the terrain is rendered the same on both sides. Maybe we can make it more clear by using single color to render the back side of terrain.

@OmarShehata
Copy link
Contributor

That does sound useful. The only issue I see you wouldn't be able to tell where you are if you can't see the landmarks on the imagery on the surface.

Note that it is currently possible to specify the alpha of the backfaces of the globe (see https://cesium.com/docs/cesiumjs-ref-doc/GlobeTranslucency.html?classFilter=globe#backFaceAlpha) but this is specifically affecting all surfaces pointing away from the camera. In your case it sounds like you want the color of the entire ground to change when the camera is underground.

Can you tell us a bit more about your use cases and the type of data you're visualizing underground?

@vinstics
Copy link
Author

@OmarShehata It maybe something like this.
image

image

image

@lilleyse
Copy link
Contributor

@vinstics you might be able to use globe.undergroundColor for this. See this sandcastle demo

underground-color

@vinstics
Copy link
Author

vinstics commented Jun 12, 2020

@lilleyse @OmarShehata
Thanks a lot. Looks good enough. It keeps the shadow of the terrain without rendering by using alpha. However, there is still room for improvement when using it together with globe.translucency.
Something like undergroundColorGradientByDistance might help, which can blend backside of the terrain with some color you want while keeping the center of the globe remain black.

underground
image

above the terrain
image

@lilleyse
Copy link
Contributor

@vinstics yeah I see, the current system only supports one color but for your case you would need two.

As a partial workaround you could check when scene.cameraUnderground is true or not and change the color based on that: Sandcastle example

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

No branches or pull requests

3 participants