This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[core] better symbol fading with texture lookups (#4579)
- this is simpler than predicting opacity based on current zooming speed - this is smoother: symbols don't flicker when changing zoom speed or when zooming in and out rapidly. mapbox/mapbox-gl-js@1df1466 fix #4562
- Loading branch information
1 parent
99e2504
commit 4c62a55
Showing
10 changed files
with
135 additions
and
162 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,11 @@ | ||
uniform sampler2D u_texture; | ||
uniform sampler2D u_fadetexture; | ||
uniform float u_opacity; | ||
|
||
varying vec2 v_tex; | ||
varying float v_alpha; | ||
varying vec2 v_fade_tex; | ||
|
||
void main() { | ||
gl_FragColor = texture2D(u_texture, v_tex) * v_alpha; | ||
float alpha = texture2D(u_fadetexture, v_fade_tex).a * u_opacity; | ||
gl_FragColor = texture2D(u_texture, v_tex) * alpha; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.