This repository has been archived by the owner on Mar 23, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This prepares the shaders for the switch to data driven styling where opacity and color need to be passed to the shader independent of eachotehr. remove the `additionalOpacity` parameter from `util.premultiply`
- Loading branch information
Showing
5 changed files
with
10 additions
and
5 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,8 @@ | ||
precision mediump float; | ||
|
||
uniform lowp vec4 u_color; | ||
uniform lowp float u_opacity; | ||
|
||
void main() { | ||
gl_FragColor = u_color; | ||
gl_FragColor = u_color * u_opacity; | ||
} |
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,11 +1,12 @@ | ||
precision mediump float; | ||
|
||
uniform lowp vec4 u_color; | ||
uniform lowp float u_opacity; | ||
|
||
varying vec2 v_pos; | ||
|
||
void main() { | ||
float dist = length(v_pos - gl_FragCoord.xy); | ||
float alpha = smoothstep(1.0, 0.0, dist); | ||
gl_FragColor = u_color * alpha; | ||
gl_FragColor = u_color * (alpha * u_opacity); | ||
} |
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