-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Globe atmosphere + Style specification #11590
Conversation
bb1902a
to
d61d506
Compare
3ea5c15
to
6433b69
Compare
59f42dd
to
e6fd7f5
Compare
a523f9d
to
89f778c
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! Are we supposed to have a default preset available when switching to globe view? Rest of the debug pages (e.g. terrain-debug.html) have no atmosphere set.
540a16e
to
4c96d22
Compare
No, there's no dependency between globe-view and atmosphere at the spec level. e.g. when setting globe-view we don't automatically enable the atmosphere. To improve UX, this is something to consider fixing at a higher level in Studio/when setting default styling, so that we're not adding dependencies between different style specification entries.
I've updated most of the pages in latest to use the default atmosphere. There are two follow-ups to this PR that I've captured in other tickets:
globe-fill-extrusion.movOtherwise please take another look as this is ready for another review, I think I've addressed all of the other comments. |
…ion of atmosphere specific buffers and not tie it to globe view projection
…osphere fixed range on globe
… that `asin` input bounds are correct https://github.com/mapbox/gl-js-team/issues/410
…og was already set
ce01afb
to
682392e
Compare
src/shaders/atmosphere.fragment.glsl
Outdated
// exponential curve | ||
// [0.0, 1.0] == inside the globe, > 1.0 == outside of the globe | ||
// https://www.desmos.com/calculator/l5v8lw9zby | ||
float t = exp(-horizon_angle * pow(u_fadeout_range, -1.0)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this an optimization to write pow(x, -1)
instead of 1/x
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not an optimization, that's an overlook from converting the function from desmos, thanks for pointing that out I'll update it!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes I noticed! That is a better option 👍
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Atmosphere style specification
This PR extends the fog system to allow design of an atmosphere effect supported on both globe and mercator projections. It extends the
fog
style specification to account for three new values:high-color
,space-color
andstar-intensity
. Thestar-intensity
allows for a parallax effect while rotating and panning the globe to increase the effect of 3d.Changelist
atmosphere
debug page with different preset to test the featureGlobeSharedBuffer
so that it's not tied to globe renderingmap.setFog({})
results in a nice default for the userfake-cubemap.mov
Style specification entries (including old ones):
color
alpha channelcolor
rgb channelshorizon-blend
high-color
alpha channelhigh-color
rgb channelsspace-color
alpha channelspace-color
rgb channelsstar-intensity
Follow up to address after this PR
Fix horizon angle line visual artifact, referhttps://github.com/mapbox/gl-js-team/issues/410Launch Checklist