Help us test the new underground features in CesiumJS

We’ve been working on improving support for underground visualization in CesiumJS - which includes the ability to ability to make the globe translucent in order to see 3D Tiles/entities underground, as well as improved camera controls when inspecting these data sources that are below the ground:

This has been one of the most highly requested features recently and we need your help testing it! The proposed API lets you disable camera collision with the ground, and control a few options on the globe translucency, like whether it has a fixed translucency or whether it it fades in/out at a certain distance:

viewer.scene.screenSpaceCameraController.enableCollisionDetection = false;
viewer.scene.globe.translucencyEnabled = true;
viewer.scene.globe.frontFaceAlphaByDistance = new Cesium.NearFarScalar(50.0, 0.0, 100.0, 1.0);

Here’s how you can contribute:

2 Likes

There is some discussion here about being able to only make a specific area translucent, as opposed to making the whole globe translucent: Viewing Tiles under surface - Imagery obscures tiles

I wanted to add that if you’re unable to share your data/use cases publicly you can always direct message me on the forum or reach out to hello@cesium.com.

Thanks to everyone who has reached out so far! Here’s a few things we’ve noted/improved since:

  • You can now specify a rectangle to enable translucency on instead of the whole globe:

  • Working on making the camera controls for going underground more intuitive
  • Considering creating a “depth fail material” for 3D Tiles so you can choose to highlight which parts of your tileset are underground.

Hi,the live sandcastle page opened and encountered some 404 errors.

Hmm, it looks like the latest commit has some failing unit tests, maybe that’s why the automatic deployment broke. In the meantime, here’s what you can do to run this Sandcastle locally:

1 Like

May be newbie question: Underground in this context means also underwater in oceans and other water basins?

1 Like

Good question! These PRs don’t cover underwater. I think that’ll be part of a separate effort here: https://github.com/CesiumGS/cesium/issues/5665.

2 Likes

5 years ago I experimented with going underground in Cesium.

A major thing I noticed was the grid of skirts (same phenomenon with Google Earth)

I see that this new version of Cesium fixes that, and it looks great!

Another change I’ve noticed is the showing of textures for surface normals facing away from the camera, very cool!

Maybe show a orange (magma) ‘sky’ indicating that you’re underground so you don’t start thinking that mountains are valleys! Like the blue sky above, the orange sky below gets lighter (or darker) the closer you look toward the center of the Earth.

I noticed that while getting close to a surface it turns transparent so you can see through it which is awesome! (just noticed you’ve listed vars regarding this on the 1st post.) Perhaps this Superman X-ray mode could be expanded allowing you to through multiple overlapping surfaces. This would allow one to see a road surface behind a mountain. Currently you have to go into a mountain to see a road or valley behind it. Basically show all overlapping transparently, except the last surface. Granted this might end up looking very messy with too many overlapping transparencies, perhaps limiting to 2 or 3 would work OK. Each layer with a different alpha value.

This new feature can assist in planning of future tunnel systems. I believe that underground tunneling is the future of intra-continental transportation, even down to the local level in high population density areas. Hyperloop makes alot of sense. I think Elon Musk realized that putting it underground makes the most sense when he created the Boring company a few years ago.

By going underground:
-you can eliminate wasted energy of going up and down that you deal with by following surface terrain contouring.
(aircraft taking off and gaining 30k+ feet altitude is wasted energy as well, and it can crash)
-maintaining an air seal in the tubes is easier with tunnels (a small break in the tube is no big deal, air isn’t going to start rushing in.)

Low pressure tubes:
-Aircraft travel at high altitudes for low density air (low friction), the same can be obtained with low pressure tubes
-Jets use fossil fuel so they pollute. Tubes can use electric energy gathered from renewable energy sources

With a tube system you can have ‘tube ports’ all over the place. Aircraft are limited to a few ‘air ports’.

Underground density mapping might be useful for tunneling. Perhaps low density paths can be found, avoiding having to slowly bore through very dense rock.

Ancient buried city discovered without digging, would be neat to see this displayed in Cesium.

EDIT: just noticed this article from 2 days ago

Perhaps Cesium could reach out to the Boring Company and/or these casinos, demonstrating the underground tunnel visualization capabilities.

2 Likes

Thanks for all the feedback @Hyper_Sonic! It’s cool to see these very early experiments and see where it all is now. I did also stumble on this ancient city article, I’d love to get my hands on that data to try it out.

@Hyper_Sonic Great thoughts. I like the orange magma idea to help stay oriented while underground.

Thanks! Apparently there is alot of data there

“28.68 billion data points, or about 4.5GB of raw data per hectare (2.47 acres)”
I wonder if those data points include depth to make a 3d map.

Perhaps tunnels could be made to be translucent as well, or at least have the option to toggle the showing of a tunnel’s outside surface (like noclip in games) so you can see a car traveling through it, for example. It would be neat to see this LA tunnel in Cesium, with a model car running through it. Imagine watching the car in the tunnel at the same time as seeing exactly what buildings it’s traveling under

I should probably update my Cesium gamepad plugin on GitHub to work with the latest Cesium version. I just got it working with Cesium 1.70.1 on Glitch simply by changing Cesium.Matrix4.getMatrix3 calls in place of the now deprecated Cesium.Matrix4.getRotation method, and altering a couple of lines that gets data from gamepad.

1 Like

Yeah we should be able to just upload those point clouds to Cesium ion to visualize them in 3D (or run it through a mesh reconstruction pipeline).

I don’t think I’ve seen this! This’d be cool to see a thread on in the showcases category maybe with some instructions about how it works so others can check it out/ask questions.

I did post about it on the Cesium Google Groups forum 5 years ago (I see that those posts have been migrated to this discord forum.) Somewhere down the road the gamepad portion broke simply due to the app/plugin not properly handling gamepad null results (which had not occurred before), then Matrix4.getRotation changed to Matrix4.getMatrix3 in the past year. It originally was just for 3DMice (6DOF variable axis control) but there’s no reason why it can’t handle any gamepad compatible device which includes pretty much all USB HID devices (even without drivers.) I just now got imagery and terrain working on it with the latest Cesium 1.70.1 on Glitch. I’ll continue to work on it some more then update it on GitHub. Browser support for gamepad API is much better now than it was 5 years ago as well (it worked on Chrome and Opera because both used Chromium engine, now Microsoft’s browser uses Chromium as well.)

I’ve been checking out Cesium 1.70.1 with 3DMouse control a bit, and noticed that tile skirts are still present when above ground, as there’s a slight transition when going underground where it’s just like it was on that underground video I made 5 years ago (with skirts). When going further underground the tile skirts disappear and textures show up on tiles facing away from you, and in some cases you can see through the seam between tiles (depending how contrasting the texture is with the background.) Perhaps tile skirts could be modified to always go in the opposite direction of the camera. So when going underground instead of disappearing the skirts simply flip direction. Though skirts should not be shown for transparent tiles (texture alpha less than 1.)

I see there were lots of underground stuff put in this month
github.com/CesiumGS/cesium/blob/master/CHANGES.md#1700---2020-06-01
globe translucency
underground color (fogging)
and Improved camera controls when the camera is underground

2 test examples of color here
github.com/CesiumGS/cesium/pull/8867/commits/f6a9d6ff8554755c32b0dbd6f589acfe34637cdd#diff-655aabc1875ffaec9c604e41f89ab90dR421

I see Color.RED and Color.BLACK. Seems like we can also choose RGBA value
var color = Cesium.Color.fromRgba(0x67ADDFFF);
cesium.com/docs/cesiumjs-ref-doc/Color.html

Some documentation on translucency here
https://cesium.com/docs/cesiumjs-ref-doc/GlobeTranslucency.html
So if you set near at 0.5 any nearer than near will cap at 0.5
If you set far at 1 any farther than far will cap at 1
And in between I assume interpolates between 0.5 and 1

cesium.com/docs/tutorials/cesium-workshop/
mentions
npm install
npm start
However no npm build, is build only for the zip you’ve linked to?

Also years ago I did node server.js to start a local web server for running locally, I suppose npm start replaces that? I got fed up with the lag on Glitch so I gotta switch back to local development like I did before. EDIT: back in business, running locally again.

1 Like

Hi, I’m Xavier Fischer, author of DEM Net Elevation API. This Twitter thread got me there : https://twitter.com/ElevationApi/status/1284252670866464769?s=20
The API is about Digital Elevation Models and other terrain related content. We have built a 3D content pipeline allowing fast generation of 3D glTF models (see here: https://sketchfab.com/xfischer/models)

We are currently experimenting (outside of Cesium) cave generation from Visual Topo files (Visual Topo is a freeware made by Eric David).
This work is done in the context of “Heritage” : small Speleologists Clubs in France have gathered a huge quantity of cave data from a rich region, and they are the only holders of that information (no human trace, no interest from local authorities).
However those caves altogether in a whole are rich in meanings and interpretation (geology, hydrology, geomorphology) and must be published for legacy (further analysis and explorations)

The goal of the project is to built a more global pipeline and to enrich current glTF models with all relevant information (profile section, geological annotations). This work is conducted by me and the speleologists.

Sketchfab is the publishing platform now, as it allow easy sharing of a “subset” and allows bugfixing more easily.

Cesium is an alternative, as it could ease the combination of multiple models and maybe more.

How can I get started ? I’ve downloaded CesiumJS and previously played with the playground.

Which coordinates should the model be ? (I’ve understood that 3857 is OK).

Any help would be appreciated.

1 Like

Welcome to the Cesium community Xavier!

This sounds like a really awesome project. To get your models into CesiumJS they’ll need to be in a local coordinate system. You can geolocate them either visually using the location editor (see https://cesium.com/docs/tutorials/integrating-with-3ds-max/#geolocating-your-data) or by using the REST API to pass in a longitude/latitude/height when uploading your model.

For the DEM data, if you can export it as a GeoTIFF, you can upload that to Cesium ion and it’ll automatically get reprojected/placed in the right place. That allows you to combine it with Cesium World Terrain (or your other terrain files), and drape satellite imagery over it, or other lines/data.

Hi @omar and thanks for the reply.

I don’t think I need Cesium Ion now, but only CesiumJS, here’s why :
I already have generated my glTF models and was planning to start from the “Globe Translucency” (https://sandcastle.cesium.com/?src=Globe%20Translucency.html) sample, where models are loaded on the fly. My models can include terrain but this is optional.
My models are using a Web Mercator projection and are X/Y centered on origin. (so this is their “local” coordinate system, where units are still meters).

Makes sense ?

1 Like