Extend linestring renderer with GLSL and indexed geometries.

This commit is contained in:
GaborFarkas
2016-06-06 17:39:12 +02:00
parent caeb8e4820
commit c7edd21cc3
4 changed files with 229 additions and 33 deletions
@@ -0,0 +1,34 @@
//! NAMESPACE=ol.render.webgl.linestringreplay.shader.Default
//! CLASS=ol.render.webgl.linestringreplay.shader.Default
//! COMMON
//! VERTEX
attribute vec2 a_position;
uniform mat4 u_projectionMatrix;
uniform mat4 u_offsetScaleMatrix;
uniform mat4 u_offsetRotateMatrix;
void main(void) {
mat4 offsetMatrix = u_offsetScaleMatrix;
vec4 offsets = offsetMatrix * vec4(0., 0., 0., 0.);
gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.) + offsets;
}
//! FRAGMENT
uniform float u_opacity;
uniform vec4 u_color;
void main(void) {
gl_FragColor = u_color;
float alpha = u_color.a * u_opacity;
if (alpha == 0.0) {
discard;
}
gl_FragColor.a = alpha;
}