Use simpler, faster shader when brightness, contrast, hue and saturation are unchanged

This commit is contained in:
Tom Payne
2013-04-08 15:55:55 +02:00
parent f7f799be27
commit ee54aaaea4
6 changed files with 388 additions and 207 deletions

View File

@@ -0,0 +1,30 @@
//! NAMESPACE=ol.renderer.webgl.map.shader.Default
//! CLASS=ol.renderer.webgl.map.shader.Default
//! 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;
}