forked from organicmaps/organicmaps
Shaders changed to support pattern
This commit is contained in:
parent
768f823431
commit
e1ba0eb746
2 changed files with 11 additions and 7 deletions
|
@ -9,7 +9,8 @@ varying MAXPREC vec4 v_centres;
|
|||
varying MAXPREC vec2 v_type;
|
||||
|
||||
varying lowp vec4 v_colors;
|
||||
varying lowp float v_index;
|
||||
varying lowp vec2 v_opacity;
|
||||
varying mediump vec2 v_index;
|
||||
|
||||
~getTexel~
|
||||
|
||||
|
@ -38,9 +39,10 @@ void sphere_join(MAXPREC float gip2, lowp vec4 baseColor, lowp vec4 outlineColor
|
|||
|
||||
void main(void)
|
||||
{
|
||||
int textureIndex = int(v_index);
|
||||
lowp vec4 baseColor = getTexel(textureIndex, v_colors.xy);
|
||||
lowp vec4 outlineColor = getTexel(textureIndex, v_colors.zw);
|
||||
int textureIndex = int(v_index.x);
|
||||
lowp float a = getTexel(int(v_index.y), v_opacity.xy).a;
|
||||
lowp vec4 baseColor = getTexel(textureIndex, v_colors.xy) * a;
|
||||
lowp vec4 outlineColor = getTexel(textureIndex, v_colors.zw) * a;
|
||||
MAXPREC float r = v_radius.y;
|
||||
MAXPREC float dist = abs(v_radius.x);
|
||||
gl_FragColor = baseColor;
|
||||
|
|
|
@ -3,7 +3,7 @@ attribute highp vec4 deltas;
|
|||
attribute highp vec4 width_type;
|
||||
attribute highp vec4 centres;
|
||||
attribute lowp vec4 colors;
|
||||
attribute mediump float index;
|
||||
attribute mediump vec4 index_opasity;
|
||||
|
||||
varying highp float v_dx;
|
||||
varying highp vec4 v_radius;
|
||||
|
@ -11,7 +11,8 @@ varying highp vec4 v_centres;
|
|||
varying highp vec2 v_type;
|
||||
|
||||
varying lowp vec4 v_colors;
|
||||
varying mediump float v_index;
|
||||
varying lowp vec2 v_opacity;
|
||||
varying mediump vec2 v_index;
|
||||
|
||||
uniform highp mat4 modelView;
|
||||
uniform highp mat4 projection;
|
||||
|
@ -44,5 +45,6 @@ void main(void)
|
|||
v_type = width_type.yz;
|
||||
|
||||
v_colors = colors;
|
||||
v_index = index;
|
||||
v_index = index_opasity.xy;
|
||||
v_opacity = index_opasity.zw;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue