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

FEATURE REQUEST: contour lines #5887

Closed
CHBaker opened this issue Oct 5, 2017 · 8 comments
Closed

FEATURE REQUEST: contour lines #5887

CHBaker opened this issue Oct 5, 2017 · 8 comments

Comments

@CHBaker
Copy link

CHBaker commented Oct 5, 2017

Hello, After spending some time on docs and examples as well as some google searches I could not find what I'm looking for. But I could be wrong.

The feature:
I want to be able to draw contour lines on the globe, starting flat on the surface, and rising up as the lines get closer together creating a contour topo map with elevation above the globe. More specifically, on I can use for a signal data set. For example, if there is a signal with it's strongest point at coordinates (a,b) with the signal weakening around it, the shape would be like a mountain with contour lines, the highest point at coordinates (a,b) with multiple tiers going down the mountain, creating a 3E 'hot spot' effect (but not like the hot spot example in the docs)

If this is already a feature, Awesome! I'd love to know what i'm missing.

if this has a 3rd party API, great! just point me in the right direction

else: is anyone else interested in something like this?

@pjcozzi
Copy link
Contributor

pjcozzi commented Oct 5, 2017

Good timing, @CHBaker! We were just talking to @jasonbeverage who has been cooking this up.

@jasonbeverage do you have a screenshot and branch you can share in the meantime before the pull request is open?

@jasonbeverage
Copy link
Contributor

Perfect timing :)

I'm working on the ability to modify the shaders of the globe at runtime and one of the examples I'm working on is drawing contour lines based on the elevation.

slope

This screen shot shows two additional shaders ran after the stock globe fragment shader. One is an elevation contour shader (the red lines) and the other is a color ramp based on the slope of the terrain.

You can play with the demo live here: https://cesiumglobematerial.netlify.com/apps/sandcastle/?src=Shader%20Composition.html&label=Showcases

The branch I'm currently working on is here: https://github.com/jasonbeverage/cesium/tree/globematerial

Don't put too much stock into it yet, I'm just hacking until I get things flushed out and then I will probably start with a clean branch ;)

I'm hoping to put together a PR for this in the next couple of weeks, so any ideas or feedback is appreciated.

Your particular use case is interesting b/c it sounds like you don't really want contours based on elevation, you want contours based on some computed signal strength. What format is your signal strength data in? Do you have a tiled raster dataset for the signals? If so I could picture adding custom shaders to an ImageryLayer to modify how they are rendered in addition to my current post processing mechanism.

@CHBaker
Copy link
Author

CHBaker commented Oct 6, 2017

@jasonbeverage hey thanks for the detailed response! That's awesome, and pretty close, and that is correct, I don't want to use terrain, I essentially want to use 'fabricated terrain' if you will, to represent data hot spots.

Right now I'm waiting on a refactored data structure from another company, so I don't know the data structure yet. But if a tiled raster data set is gonna be the best way to go that is good to know. But I'll let you know when I do.

@NaderCHASER
Copy link
Contributor

I have a PR open for applying a LUT to a tiled ImageryLayer. There hasn't been much progress on it, but essentially we use the Red band of a PNG to "bake in" the raw data values (with a known minimum & maximum, you can normalize). This then allows us to apply a LUT to meteorological datasets (satellite, radar and numerical models).

See here: #4953

I would love input that might move this PR forward, as it's been a high priority since early this year.

@jasonbeverage
Copy link
Contributor

Here is a shot of an elevation color ramp generated with this.

I'm hoping to have at least a preliminary PR for this by the end of the week, but we'll see ;)

heightramp

@CHBaker
Copy link
Author

CHBaker commented Oct 10, 2017

Awesome! an elevation color map would do that job also, another good way to visualize a focused data area. is that gonna be rendered with fabricated elevation?

@jasonbeverage
Copy link
Contributor

So right now I'm not focusing on "fabricated" elevation, only on the actual elevation data that is passed through. The gist of what I am doing is adding Material support to the Globe, so you can basically write your own fragment shaders that control the final coloring of the globe.

I think what you are probably after (and also what @NaderCHASER is after) is more along the lines of having a Material per ImageryLayer that can control how the RGB values are interpreted on a per layer basis. We have something similar in osgEarth called a ColorFilter, but for now that is outside of the scope of the work I'm currently doing.

If I can get this initial PR included then perhaps I can try to add Material support to the Image Layers after that.

@hpinkos
Copy link
Contributor

hpinkos commented Dec 4, 2017

Added in #5919

@hpinkos hpinkos closed this as completed Dec 4, 2017
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

5 participants