use GLShader for PolygonLayer
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
#ifdef GLES
|
||||
precision mediump float;
|
||||
#endif
|
||||
uniform mat4 u_mvp;
|
||||
attribute vec4 a_pos;
|
||||
void main() {
|
||||
gl_Position = u_mvp * a_pos;
|
||||
}
|
||||
§
|
||||
$$
|
||||
#ifdef GLES
|
||||
precision mediump float;
|
||||
#endif
|
||||
uniform vec4 u_color;
|
||||
void main() {
|
||||
gl_FragColor = u_color;
|
||||
28
vtm/resources/assets/shaders/polygon_layer_tex.glsl
Normal file
28
vtm/resources/assets/shaders/polygon_layer_tex.glsl
Normal file
@@ -0,0 +1,28 @@
|
||||
#ifdef GLES
|
||||
precision mediump float;
|
||||
#endif
|
||||
uniform mat4 u_mvp;
|
||||
uniform vec2 u_scale;
|
||||
attribute vec4 a_pos;
|
||||
varying vec2 v_st;
|
||||
varying vec2 v_st2;
|
||||
void
|
||||
main(){
|
||||
v_st = clamp(a_pos.xy, 0.0, 1.0) * (2.0 / u_scale.y);
|
||||
v_st2 = clamp(a_pos.xy, 0.0, 1.0) * (4.0 / u_scale.y);
|
||||
gl_Position = u_mvp * a_pos;
|
||||
}
|
||||
$$
|
||||
|
||||
#ifdef GLES
|
||||
precision mediump float;
|
||||
#endif
|
||||
uniform vec4 u_color;
|
||||
uniform sampler2D tex;
|
||||
uniform vec2 u_scale;
|
||||
varying vec2 v_st;
|
||||
varying vec2 v_st2;
|
||||
void
|
||||
main(){
|
||||
gl_FragColor = mix(texture2D(tex, v_st), texture2D(tex, v_st2), u_scale.x);
|
||||
}
|
||||
Reference in New Issue
Block a user