-
-
Notifications
You must be signed in to change notification settings - Fork 67
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
Design proposal: Atmosphere / Sky parameters #163
Comments
@louwers - this would of course influence Native when the time for atmosphere comes |
Also probably worth bringing this up in the next TSC meeting. |
The only input I have regarding this proposal is that if in the future globe view will be implemented, how would this proposal change, if at all. |
Seems like cesium has more parameters to the sky, including the sun: |
Demo of all the many parameters of Cesium - https://sandcastle.cesium.com/?src=Atmosphere.html |
The mobile version of the above page is just so bad... Man... I'm surprised people are still writing non-responsive sites theses days... 😕 |
I made PR #298 here to separate the style-spec changes from the maplibre-gl-js changes in maplibre/maplibre-gl-js#1713 The style spec changes at #298 are relevant to this issue since it implements the proposed change in style spec. I'm sure if we want more properties, more would need to be added to this. I made @acalcutt/maplibre-gl-style-spec v19.3.2 which includes these changes, but I haven't quite had luck testing it in my test maplibre-gl-js branch yet (still testing with maplibre/maplibre-gl-js#2974). |
Since I don't have a better idea what parameters can be add to the sky let's continue with this design proposal, these parameters make sense to me as opposed to the huge number of parameters in the cesium page which are not intuitive. |
I'll push forward the linked PR. |
Thanks for tagging me. Cesium's approach is the right one if you're doing a true globe and want a real atmosphere both for space and the ground. So my suggestion is not to address that if there's no globe mode planned. The shader can get pretty complex. But there's nothing wrong with hacking it. A gradient is a nice idea, going from horizon on up. Beyond that, maybe toss an image in there oriented with... I guess the horizon would do. Or maybe the middle of the image is the horizon and it goes up and down from the middle. Thinking about how to implement that, it's probably not too hard either way. |
There's is an implementation that got a bit stale here, I hope to push it forward after this issue is properly defined: The parameters described in Cesium are very complicated and I wouldn't want a map designer to configure all of these, it's just too much (even with good defaults). So the main question here, after the "is it possible?" question would be if the spec design is clear enough and makes sense, or you think there are other parameters that might be interesting? |
I've created the above linked PR: #478, feel free to review it. |
I believe when looking at the map in 2D you don't want it "as realistic" as 3D. A design consideration I believe, not sure though. @prozessor13 do you remember why? |
Hi Harel, The sky is rendered beyond the map and is available in both, 2D and 3D. |
I'm not sure this is finalized as there is a comment, which I'm not sure is well defined regarding the spec about a secondary color to the sky, see here: I'm not 100% sure how this would look in the spec though. |
Okay, i had an impression it was done for this repo when this landed, but haven't tracked it close enough clearly - #478 |
Written by @prozessor13 here: It should be easy to implement a second sky color to create a 2-color gradient, and i think i can find time for this the next weeks. proposal:
I am really not sure how to name the parameters. please make better suggestions. For sure this proposal is very limited in features, but may sufficient in most scenarios? What do you think? |
I think the names are good, the only thing that is not intuitive is the fog-blend - blend between fog and what? |
what do you think about: |
@Pheonor what do you think since you are looking into atmosphere effects now? |
As mention here the feature of accurate star map / sky box that shifts with the globe might be really an extension of the sky spec. maplibre/maplibre-gl-js#3889 as mentioned elsewhere this feature is like cesium https://sandcastle.cesium.com/?src=Atmosphere.html Note how they split this into ground atmosphere and sky atmosphere and I'm not sure whether are 2 effects on the actual map and on the sky; As mentions in the projection issue above it seems that he sky parameters would be used for both the globe mode and the terrain mode I suspect there should be a general style that is easy for end users and describes the actual visual effect desired and the we would need to remap that to specific options in the terrain mode and globe mode let style = {
projection: {
type: "globe",
sky: {...__globeSpecificScyOptions}
}
terrain: {
sky: {...__terinaSpecificSkyOptions}
}
//note the above may be 'internal'
sky: {
"sky-color": "#199EF3", // maybe background-color sky is redundant
"fog-color": "#00ff00",
"horizon-blend": 0.5,
"fog-blend": 0.6,
//proposed
"skybox": "simple static cube map background"
}
maybe this could be something like this:
https://en.wikipedia.org/wiki/Galactic_coordinate_system (or a new innovated way of mapping / rendering the sky ???) this is interesting also see that first comment for a for more links on the topic. In theory this would be a nice addition as zooming out or rotating the camera up from terrain mode could offer users a realistic view of the night sky. I can think of many useful project that would love this such as mapping space objects. allowing users to view constellations from terrain mode etc. even render a skybox dependent on the local time of day would all be possible. Also it would just look really cool to map stuff on the earth as it actual is in the galaxy. |
Effectively, adding a 'ground' prefix could be a good idea. |
The current proposition for atmosphere use three parameters:
Do you think a dedicated 'atmosphere' section is possible ? |
I believe we can have a section inside the sky for atmosphere, or do you think it should be a different section altogether? I find the sky and atmosphere to be connected. |
Effectively, an atmosphere section into the sky section could be a good option.
For the timezone, I propose to use only UTC. |
Can you clarify the definitions then?
Not sure the above spec is well defined in terms of spec and is intuitive enough, maybe we should get some inspiration from existing style spec definitions such as transition maybe... IDK... |
This is exactly what you are describing. |
Maybe we can use something like the light position that is described here: |
Sun position could effectively be expressed with something similar. In fact, this system could be complicated to use and do not allow to create a realistic position of the Sun. |
Wait, shouldn't the sun's position be defined by the light angle? |
Some thoughts.... Sun position for atmosphere and sun position for fill-extrusion doesn't necessarily need to be the same, unless someone makes a map where fill-extrusion and (globe) atmosphere are visible at the same time, then light position should probably be consistent, but that can be the responsibility of whoever is creating the map style. Maybe both fill-extrusion and atmosphere can select a light, defined by the light spec? This would require the light-spec to be modified to allow for multiple light sources. Also, looking at the actual current implementation of light for fill-extrusion, doesn't the With the current spec, I don't think there is a point in specifying the light's distance, interpreting the light as a purely directional, infinitely-distant light source (such as the sun) is probably good enough. (Or does MapLibre need to support point lights?) I think another anchor type for light would be useful, in addition to the unmodified first two. The functionality could be as follows:
I think an intuitive way of specifying the light's direction is longitude and latitude of the location at which the sun is directly overhead. This works seamlessly with the |
Note that light is also relevant to hill-shading, not just fill extrusion. Looking at the definitions above with I think that sun direction over null island is a very intuitive definition (assuming the distance is infinity obviously), but we shouldn't change the current definition of light in order not to break backwards compatibility). Regarding what I wrote above about
|
Ok for the position definition of light. I propose to keep a parameter to define the mode as a position or 'auto' to compute the Sun position based on current date and time. |
I've updated the initial post to have the most up-to-date definition I know of. |
It is Ok for me for the atmosphere paremeters. |
Yes, let's use the existing light property for the sun position over null island as an initial implementation. |
Currently atmosphere has only one parameter. I'll collapse it into the sky definition for now. |
I've added the definition to the style spec and released a new version. |
Design Proposal: Atmosphere / Sky
Motivation
It would be great to have not just a solid color, but a nice atmosphere gradient as the backdrop for the map. The suggested changes are in production here: https://www.maptoolkit.com/map/#/@13.02403,46.59774,12.6,-35.2,75,terrain,3d
A PR of that implementation is here
Proposed Change
Add a sky parameter, like this:
horizon-fog-blend: same as horizon-blend in current definition
fog-blend: same as current definition
API Modifications
Outline what modifications you expect on the API due to your change.
Migration Plan and Compatibility
We can have this disabled at first, with options to enable a feature flag. The code is supposed to be backwards compatible.
Rejected Alternatives
The text was updated successfully, but these errors were encountered: