Update color matrices based on framestate values

In getColorMatrix method, we'll update the color matrices only if layerstate
color properties has changed in the framestate.
This commit is contained in:
Bruno Binet
2013-08-12 11:16:52 +02:00
parent 46ea218d0f
commit 8b435059f7
2 changed files with 54 additions and 50 deletions

View File

@@ -643,7 +643,12 @@ ol.renderer.webgl.Map.prototype.renderFrame = function(frameState) {
layerRenderer.getProjectionMatrix());
if (useColor) {
gl.uniformMatrix4fv(locations.u_colorMatrix, false,
layerRenderer.getColorMatrix());
layerRenderer.getColorMatrix(
layerState.brightness,
layerState.contrast,
layerState.hue,
layerState.saturation
));
}
gl.uniform1f(locations.u_opacity, layerState.opacity);
gl.bindTexture(goog.webgl.TEXTURE_2D, layerRenderer.getTexture());