Pixel-Composer/shaders/sh_level/sh_level.fsh

32 lines
696 B
Text
Raw Normal View History

2022-01-13 05:24:03 +01:00
//
// Simple passthrough fragment shader
//
varying vec2 v_vTexcoord;
varying vec4 v_vColour;
2022-12-27 04:00:50 +01:00
uniform float wmin;
uniform float wmax;
uniform float rmin;
uniform float rmax;
uniform float gmin;
uniform float gmax;
uniform float bmin;
uniform float bmax;
2023-01-01 02:06:02 +01:00
uniform float amin;
uniform float amax;
2022-01-13 05:24:03 +01:00
void main() {
vec4 col = v_vColour * texture2D( gm_BaseTexture, v_vTexcoord );
2022-12-27 04:00:50 +01:00
col.r = (col.r - rmin) / (rmax - rmin);
col.g = (col.g - gmin) / (gmax - gmin);
col.b = (col.b - bmin) / (bmax - bmin);
2023-01-01 02:06:02 +01:00
col.a = (col.a - amin) / (amax - amin);
2022-12-27 04:00:50 +01:00
col.r = (col.r - wmin) / (wmax - wmin);
col.g = (col.g - wmin) / (wmax - wmin);
col.b = (col.b - wmin) / (wmax - wmin);
2022-01-13 05:24:03 +01:00
gl_FragColor = col;
}