核心代码:
1 varying highp vec2 textureCoordinate; 2 3 uniform sampler2D inputImageTexture; 4 uniform highp float exposure; 5 6 void main() 7 { 8 highp vec4 textureColor = texture2D(inputImageTexture, textureCoordinate); 9 10 gl_FragColor = vec4(textureColor.rgb * pow(2.0, exposure), textureColor.w); 11 }
其中exposure的取值范围为[-10,10]
https://github.com/BradLarson/GPUImage