mirror of
https://github.com/Ttanasart-pt/Pixel-Composer.git
synced 2024-12-25 14:36:13 +01:00
31 lines
696 B
GLSL
31 lines
696 B
GLSL
//
|
|
// Simple passthrough fragment shader
|
|
//
|
|
varying vec2 v_vTexcoord;
|
|
varying vec4 v_vColour;
|
|
|
|
uniform float wmin;
|
|
uniform float wmax;
|
|
uniform float rmin;
|
|
uniform float rmax;
|
|
uniform float gmin;
|
|
uniform float gmax;
|
|
uniform float bmin;
|
|
uniform float bmax;
|
|
uniform float amin;
|
|
uniform float amax;
|
|
|
|
void main() {
|
|
vec4 col = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
|
|
|
|
col.r = (col.r - rmin) / (rmax - rmin);
|
|
col.g = (col.g - gmin) / (gmax - gmin);
|
|
col.b = (col.b - bmin) / (bmax - bmin);
|
|
col.a = (col.a - amin) / (amax - amin);
|
|
|
|
col.r = (col.r - wmin) / (wmax - wmin);
|
|
col.g = (col.g - wmin) / (wmax - wmin);
|
|
col.b = (col.b - wmin) / (wmax - wmin);
|
|
|
|
gl_FragColor = col;
|
|
}
|