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
Basic Sky Implementation working with actual codebase #3645
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3645 +/- ##
==========================================
- Coverage 86.62% 86.23% -0.39%
==========================================
Files 240 244 +4
Lines 32262 32527 +265
Branches 2167 1988 -179
==========================================
+ Hits 27946 28051 +105
- Misses 3376 3542 +166
+ Partials 940 934 -6 ☔ View full report in Codecov by Sentry. |
I've opened the following issue for the spec as I have forgot to add the diff part of the sky to the relevant place in the code. |
@prozessor13 can I delete |
@acalcutt feel free to fix the unit tests as well while you are at it :-) |
I'm not sure I understand those errors
isn't it a function? maplibre-gl-js/src/geo/transform.ts Lines 724 to 736 in 32ae12b
|
The tests are mocking stuff, if the mock doesn't have a function that the test need you'll see this error. |
I don’t think it’s worth waiting for GSoC if this is good to go… but we’ll need to find something else for GSoC. I didn’t realize this was so close to being done |
* try to fix calculateFogMatrix error * Raise expectedBytes for maplibre-gl.js size
I've merged the tests fix, and merged main branch. |
Increasing coverage is always an option. |
@prozessor13 I moved the gl logic from sky class to draw_sky method, I'm not sure this is a correct approach, but generally speaking I think gl stuff should not be in the sky.ts file. |
I went over the last coverage report just now, I believe most of the relevant code is covered in tests. |
I liked this in my test page at https://wifidb.net/demo/sky/terrain.html . In practice I don't know if I would use fog, but it is a cool effect. One thing I was a bit unclear on is that fog color is the second color in the sky gradient. Right now I am using a css linear-gradient based approach for sky, which as a nice sunset color look.
to get that same effect, you have to set 'fog-color' to what you want the of the bottom sky gradient to be.
Its not really an issue, and it is fine, but I just wasn't clear on that until I started testing it. It does look a bit nicer than my css approach, since the gradient folllows the horizon better. |
I was thinking though, if i was actually using a "fog-blend" less than 1, that orange color would probably be kind of strange, since a orange fog would cover the surface. which reminds me, the style spec recommend a green color for fog, which did not look good at all.
|
The green color is an example, the default is white/gray. I guess the example is green so that you'd know what it looks like and how it affects using a "weird" color. |
I was thinking maybe and addition color, maybe named "horizon-color" could be added. then maybe it is this code where that would be used in place of 'u_fog_color'
|
I would suggest to open/continue the discussion in the style-spec repo. |
@acalcutt what's your take about the horizon color? Should we add something to the sky spec? Do you need my help to push this forward? |
In my opinion I think it would be nice to separate the fog color from the sky color, because I don't know that they should always be the same. but I also don't know what that would actually look like. I was more wondering what other people thought here. I'm not sure I have the time right now to submit a style spec PR. |
The original code from BAschl BAschl@c788339 had a logic similar line-gradient when drawing the sky. I removed all that code for simplicity. For now i think it has priority to merge this PR, and create new features later on? |
And that the fog is drawn over the sky has the intention to create an atmospheric effect for the fog. This is in my opinion completely separated from any (yet not existing) sky gradient. |
While I don't mind postponing the implementation of sky gradient, I do want to make sure we define it in the spec, or st least make sure it doesn't break the current definition. |
I simply would suggest an additional sky-gradient property :) |
How would the spec be then? |
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? |
Can you explain what |
This PR is a successor of #1713 which is working with the actual maplibre-codebase. Writing Tests is still an open issue for which i currently do not have any time :/