Files
openlayers/src/ol/renderer/webgl/defaultmapshader.glsl
Frederic Junod e25e61c3b7 Rename location shader classes
And remove the now unneeded NAMESPACE variable
2018-02-08 15:18:11 +01:00

30 lines
585 B
GLSL

//! MODULE=ol/renderer/webgl/defaultmapshader
//! COMMON
varying vec2 v_texCoord;
//! VERTEX
attribute vec2 a_position;
attribute vec2 a_texCoord;
uniform mat4 u_texCoordMatrix;
uniform mat4 u_projectionMatrix;
void main(void) {
gl_Position = u_projectionMatrix * vec4(a_position, 0., 1.);
v_texCoord = (u_texCoordMatrix * vec4(a_texCoord, 0., 1.)).st;
}
//! FRAGMENT
uniform float u_opacity;
uniform sampler2D u_texture;
void main(void) {
vec4 texColor = texture2D(u_texture, v_texCoord);
gl_FragColor.rgb = texColor.rgb;
gl_FragColor.a = texColor.a * u_opacity;
}