pathfinder/shaders/gles2/blit-gamma.fs.glsl

26 lines
739 B
Plaintext
Raw Normal View History

// pathfinder/shaders/gles2/blit-gamma.fs.glsl
2017-08-15 18:57:52 -04:00
//
2017-10-03 18:32:03 -04:00
// Copyright (c) 2017 The Pathfinder Project Developers.
//
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
// option. This file may not be copied, modified, or distributed
// except according to those terms.
2017-08-15 18:57:52 -04:00
/// Blits a texture, applying gamma correction.
2017-10-26 23:30:47 -04:00
precision mediump float;
2017-08-15 18:57:52 -04:00
uniform sampler2D uSource;
uniform vec3 uBGColor;
uniform sampler2D uGammaLUT;
2017-08-15 18:57:52 -04:00
varying vec2 vTexCoord;
void main() {
vec4 source = texture2D(uSource, vTexCoord);
gl_FragColor = vec4(gammaCorrect(source.rgb, uBGColor, uGammaLUT), source.a);
2017-08-15 18:57:52 -04:00
}